@font-face {
  font-family: Bricolage;
  src: url('/faca-parte/bricolage-3.woff2') format('truetype');
  font-display: swap;
  font-weight: 700;
}
:root {
  color-scheme: dark;
  --bg: #1b1924;
  --surface: #242230;
  --paper: #1d1b28;
  --ink: #f8f5fb;
  --muted: #beb8ca;
  --quiet: #a39bb2;
  --line: #ffffff17;
  --accent: #ff8967;
  --style: #c8afff;
  --emotion: #ffa487;
  --reaction: #80d9bf;
  --pace: #f2ca84;
  --sound: #94c5ff;
  --custom: #c9b9ed;
  --emphasis: #ffc3d8;
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: Bricolage, var(--sans);
  --mono: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 400 15px/1.5 var(--sans); color: var(--ink); background: var(--bg); }
button, input, textarea { font: inherit; color: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { cursor: default; opacity: .42; }
button, a, summary, input, textarea { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, pre { margin: 0; }
:where(a, button, input, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.symbols, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; white-space: nowrap; clip-path: inset(50%); }
.skip { position: fixed; z-index: 10; top: 8px; left: 12px; transform: translateY(-160%); padding: 8px 14px; border-radius: 8px; color: #211922; background: var(--accent); }
.skip:focus { transform: none; }

.top { border-bottom: 1px solid var(--line); background: #201e2a; }
.top-inner, .frame { width: min(100% - clamp(32px, 7vw, 112px), 1280px); margin-inline: auto; }
.top-inner { display: flex; align-items: center; gap: 30px; min-height: 70px; }
.brand { display: flex; align-items: center; }
.brand img { display: block; width: 79px; height: auto; }
.top nav { display: flex; align-items: center; gap: 5px; padding-left: 26px; border-left: 1px solid #ffffff20; }
.top nav a, .community { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 5px 12px; border-radius: 8px; color: var(--muted); font-size: .83rem; font-weight: 550; }
.top nav [aria-current] { color: #ffaf93; background: #ff987215; }
.top nav .icon, .community .icon { width: 15px; height: 15px; }
.community { margin-left: auto; padding-right: 0; }
.top a:hover { color: white; }

.intro { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: clamp(28px, 3.4vw, 52px) 0 clamp(24px, 2.6vw, 38px); }
.intro h1 { font: 700 clamp(40px, 4.7vw, 69px)/1.04 var(--display); letter-spacing: -.063em; text-wrap: balance; }
.intro h1 em { color: var(--accent); font-style: normal; }
.intro p { max-width: 68ch; margin-top: 12px; color: var(--muted); font-size: clamp(.95rem, 1.15vw, 1.04rem); }
.intro strong { font-weight: 600; color: #e6deeb; white-space: nowrap; }
.signal { position: relative; isolation: isolate; width: clamp(240px, 28vw, 390px); height: 92px; flex: none; overflow: hidden; }
.wave { position: absolute; display: flex; align-items: center; gap: 2px; inset: 2px 0 16px; background: repeating-linear-gradient(90deg, transparent 0 31px, #cbb5ed0b 31px 32px); }
.wave::before { content: ''; position: absolute; inset-inline: 0; top: 50%; border-top: 1px solid #b7a6cb33; }
.wave i { flex: 1; min-width: 1px; height: var(--level); border-radius: 9px; background: var(--wave-color); }
.wave-tag { position: absolute; bottom: 0; padding: 0 3px; background: var(--bg); color: var(--pace); font: 11px/1.2 var(--mono); }
.wave-tag::before { content: ''; position: absolute; height: 11px; bottom: calc(100% + 2px); left: 8px; border-left: 1px dashed currentColor; opacity: .55; }
.tag-soft { left: 12%; color: #bba5df; }
.tag-bright { left: 70%; color: #eaa18b; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(325px, 1fr); gap: clamp(14px, 1.7vw, 26px); align-items: start; }
.panel { min-width: 0; border: 1px solid #ffffff20; border-radius: 17px; background: var(--surface); box-shadow: 0 9px 28px #110e1c21; }
.panel-head, .head-name, .quiet, .tool, .history, .icon-button, .primary, .secondary, .visit, .open-palette, .modal-actions { display: flex; align-items: center; }
.panel-head { justify-content: space-between; gap: 12px; min-height: 66px; padding: 14px 21px; border-bottom: 1px solid var(--line); }
.head-name { gap: 10px; min-width: 0; }
.head-name > .icon { width: 20px; height: 20px; color: #c7bbd8; }
h2 { font: 700 1.27rem/1.15 var(--display); letter-spacing: -.035em; }
.quiet { gap: 5px; min-height: 34px; padding: 4px 7px; border-radius: 7px; color: var(--muted); font-size: .81rem; font-weight: 550; }
.quiet:hover, .icon-button:not(:disabled):hover { background: #ffffff09; color: var(--ink); }
.quiet .icon { width: 15px; height: 15px; }
.edit-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 11px 17px; border-bottom: 1px solid var(--line); }
.tool { min-height: 32px; padding: 3px 9px; gap: 6px; color: #e2dce7; font-size: .79rem; font-weight: 550; border: 1px solid #ffffff16; border-radius: 7px; background: #ffffff03; }
.tool:hover:not(:disabled) { background: #ffffff0d; }
.tool b { font-family: var(--mono); font-size: .91rem; line-height: 1; }
.tool.emphasis b { color: var(--emphasis); }
.tool.pause b { color: var(--pace); }
.tool.interruption b { color: var(--sound); }
.history { margin-left: auto; gap: 2px; }
.icon-button { justify-content: center; flex: none; width: 32px; height: 32px; padding: 4px; border-radius: 7px; color: var(--muted); }
.icon-button .icon { width: 15px; height: 15px; }
.draft { margin: 0; background: var(--paper); }
.draft-meta, .draft-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--quiet); font-size: .74rem; }
.draft-meta { min-height: 42px; padding: 12px 24px 4px; }
#draft-state { display: inline-flex; align-items: center; gap: 7px; }
#draft-state::before { content: ''; width: 6px; height: 6px; border: 1px solid #c9b4db; border-radius: 50%; }
#draft-state[data-saved="true"]::before { border-color: var(--reaction); background: var(--reaction); }
#selection-info { color: var(--emphasis); }
.paper { position: relative; height: clamp(225px, 26vh, 320px); margin: 0 8px; }
.paper :is(textarea, pre) {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 10px 16px 16px;
  font: 450 clamp(.98rem, 1.1vw, 1.08rem)/1.8 var(--sans); letter-spacing: 0; tab-size: 4; text-align: start;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; scrollbar-gutter: stable; border: 0; border-radius: 5px;
}
.ink { overflow: auto; pointer-events: none; color: var(--ink); }
.ink::-webkit-scrollbar-thumb { background: transparent; }
#roteiro { resize: none; overflow: auto; color: var(--ink); background: transparent; caret-color: #fff1e9; }
#roteiro::placeholder { color: var(--quiet); opacity: 1; }
.editor.enhanced #roteiro { color: transparent; -webkit-text-fill-color: transparent; }
.editor.enhanced #roteiro::placeholder { -webkit-text-fill-color: var(--quiet); }
#roteiro:focus-visible { outline: 1px solid #c4a6de66; outline-offset: 0; }
#roteiro::selection { background: #926ba377; }
.mark-style, [data-kind="style"] { --tint: var(--style); }
.mark-emotion, [data-kind="emotion"] { --tint: var(--emotion); }
.mark-reaction, [data-kind="reaction"] { --tint: var(--reaction); }
.mark-pace, [data-kind="pace"] { --tint: var(--pace); }
.mark-sound, [data-kind="sound"] { --tint: var(--sound); }
.mark-custom { --tint: var(--custom); }
.mark-emphasis { --tint: var(--emphasis); }
.ink mark { color: var(--tint); background: color-mix(in srgb, var(--tint) 10%, transparent); border-radius: 4px; }
.ink .mark-emphasis { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.draft-foot { min-height: 42px; padding: 3px 24px 9px 17px; font-variant-numeric: tabular-nums; }
.paragraph-nav { display: inline-flex; align-items: center; gap: 3px; }
.paragraph-nav .icon-button { width: 25px; height: 27px; }
.paragraph-nav .icon { width: 13px; height: 13px; }
.export, .modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 17px 20px; border-top: 1px solid var(--line); }
.primary, .secondary, .open-palette { min-height: 41px; justify-content: center; gap: 8px; padding: 8px 15px; border-radius: 9px; border: 1px solid transparent; font-size: .85rem; font-weight: 650; }
.primary { background: var(--accent); color: #251b1b; }
.primary:hover:not(:disabled) { background: #ffa184; }
.primary[data-copied="true"] { background: var(--reaction); }
.secondary { color: #e4ddea; background: #ffffff04; border-color: #ffffff24; }
.secondary:hover:not(:disabled) { background: #ffffff0c; }
.export .icon, .modal-actions .icon { width: 16px; height: 16px; }
.visit { margin-left: auto; gap: 5px; min-height: 38px; color: var(--muted); font-weight: 550; font-size: .8rem; }
.visit:hover, .guide-copy a:hover { color: white; }
.visit .icon { width: 14px; height: 14px; }

.where { white-space: nowrap; border-radius: 6px; background: #ffffff07; color: #bfb6cd; padding: 3px 7px; font: .69rem/1.5 var(--mono); }
.palette-body { padding: 17px 18px; }
.categories { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 3px; background: #1b1925; border: 1px solid var(--line); border-radius: 10px; }
.categories button { position: relative; display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 33px; padding: 4px 2px; border: 1px solid transparent; border-radius: 7px; color: #bfb9cb; font-size: .78rem; font-weight: 600; }
.categories button::before { content: ''; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--tint); }
.categories button[aria-pressed="true"] { color: var(--tint); background: color-mix(in srgb, var(--tint) 12%, transparent); border-color: color-mix(in srgb, var(--tint) 25%, transparent); }
.group-hint { margin: 13px 0 12px; color: var(--muted); font-size: .79rem; line-height: 1.45; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.choice { display: flex; gap: 9px; align-items: center; min-width: 0; min-height: 43px; padding: 8px 10px; text-align: left; color: var(--ink); border: 1px solid #ffffff19; border-radius: 9px; background: #ffffff04; }
.choice:hover, .choice:focus-visible, .choice[aria-pressed="true"] { border-color: color-mix(in srgb, var(--tint) 53%, transparent); background: color-mix(in srgb, var(--tint) 9%, var(--surface)); }
.choice[aria-pressed="true"] strong { color: var(--tint); }
.choice .emoji { display: grid; place-items: center; flex: none; width: 25px; height: 27px; font: 18px/1 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; }
.choice .choice-text { display: grid; min-width: 0; gap: 1px; }
.choice strong { font-size: .86rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.choice small { font-size: .71rem; line-height: 1.35; color: var(--quiet); }
.choice .applied { color: var(--tint); margin-left: auto; }
.choice[data-suggested="true"]:not([aria-pressed="true"]) { border-color: #c8afff42; }
.suggestion { color: var(--style); font-size: .72rem; margin: 11px 1px 0; }
.subgroup { font-size: .75rem; color: var(--sound); font-weight: 600; margin: 14px 0 7px; }
.custom { border-top: 1px solid var(--line); padding: 0 19px; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.custom summary, .guide summary { display: flex; align-items: center; gap: 9px; width: fit-content; max-width: 100%; font-weight: 550; }
.custom summary { width: 100%; min-height: 45px; color: #d4c8df; font-size: .82rem; }
.custom summary .icon { margin-left: auto; width: 14px; height: 14px; }
.brackets { color: var(--custom); font: 600 .84rem var(--mono); }
details[open] > summary .icon:last-child { transform: rotate(180deg); }
.custom form { padding-bottom: 16px; }
.custom label { display: block; margin-bottom: 5px; font-size: .8rem; }
.custom-line { display: flex; align-items: stretch; gap: 7px; }
.custom input { min-width: 0; flex: 1; padding: 7px 10px; border: 1px solid #ffffff28; border-radius: 7px; background: var(--paper); font-size: .84rem; }
.custom input::placeholder { color: var(--quiet); }
.custom p { margin-top: 6px; color: var(--quiet); font-size: .74rem; }
#custom-error { color: #ffa78f; }
.guide { margin: 20px 0 40px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); }
.guide summary { min-height: 35px; font-size: .82rem; }
.guide summary .icon:last-child { width: 13px; height: 13px; }
.guide-copy { max-width: 76ch; margin: 8px 0 0 27px; font-size: .87rem; line-height: 1.6; }
.guide-copy p + p, .guide-copy a { margin-top: 8px; }
.guide-copy a { display: inline-block; color: #ffb29b; text-decoration: underline; text-underline-offset: 3px; }

.sheet, .modal { color: var(--ink); padding: 0; border: 1px solid #ffffff28; border-radius: 15px; background: var(--surface); box-shadow: 0 18px 70px #09081188; }
dialog::backdrop { background: #100e1aba; }
body:has(dialog[open]) { overflow: hidden; }
.modal { width: min(92vw, 620px); max-height: 88dvh; }
.modal #result { display: block; width: calc(100% - 32px); height: clamp(150px, 35vh, 380px); margin: 16px; padding: 14px; resize: vertical; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font: .93rem/1.65 var(--mono); }
.small-modal { max-width: 420px; padding: 22px; }
.small-modal p { margin: 11px 0 18px; color: var(--muted); }
.small-modal .modal-actions { justify-content: flex-end; padding: 0; border: 0; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 30px); width: max-content; color: var(--ink); background: #332e40; border: 1px solid #ffffff24; border-radius: 9px; font-size: .84rem; box-shadow: 0 6px 22px #0003; pointer-events: none; }
.toast:not(:empty) { padding: 9px 14px; }
.open-palette, .sheet-close { display: none; }
#dock:empty, #result-status:empty { display: none; }
#result-status { margin: 0 17px 12px; color: var(--muted); font-size: .84rem; }

@media (max-width: 950px) and (min-width: 801px) {
  .workspace { grid-template-columns: minmax(0, 1.3fr) minmax(306px, 1fr); }
  .palette-body { padding-inline: 12px; }
  .edit-tools { gap: 3px; padding-inline: 10px; }
  .choice { padding-inline: 6px; gap: 5px; }
  .export { padding-inline: 14px; }
}
@media (max-width: 800px) {
  .top-inner, .frame { width: min(100% - 32px, 650px); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .signal { width: 180px; }
  .open-palette { display: flex; width: calc(100% - 32px); margin: 13px 16px; color: var(--style); background: #c8afff12; border-color: #c8afff45; }
  .sheet { inset: auto 0 0; margin: 0 auto; width: min(100%, 650px); max-width: 100%; max-height: 86dvh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); overscroll-behavior: contain; }
  .sheet .panel { border: 0; box-shadow: none; }
  .sheet .panel-head { position: sticky; top: 0; z-index: 1; background: var(--surface); }
  .sheet .where { margin-left: auto; }
  .sheet-close { display: flex; }
  .categories button, .choice, .custom summary, .primary, .secondary, .open-palette { min-height: 44px; }
  .top-inner { min-height: 62px; gap: 15px; }
  .top nav { padding-left: 15px; }
}
@media (max-width: 560px) {
  .top-inner { gap: 10px; }
  .brand img { width: 59px; }
  .top nav { gap: 1px; padding-left: 10px; }
  .top nav a { white-space: nowrap; }
  .motion-prefix { display: none; }
  .top nav a, .community { padding: 4px 7px; font-size: .74rem; gap: 3px; }
  .community { padding-right: 0; }
  .intro { padding-block: 25px 20px; }
  .intro h1 { font-size: clamp(36px, 8.8vw, 47px); }
  .intro p { margin-top: 7px; font-size: .91rem; }
  .signal { display: none; }
  .panel-head { padding: 12px 14px; min-height: 53px; }
  h2 { font-size: 1.15rem; }
  .edit-tools { padding: 7px 10px; gap: 3px; }
  .tool { font-size: .71rem; padding: 3px 6px; min-height: 36px; gap: 4px; }
  .icon-button { width: 29px; height: 34px; }
  .draft-meta { padding: 10px 15px 3px; min-height: 33px; }
  .paper { height: clamp(225px, 35vh, 290px); margin: 0 3px; }
  .paper :is(textarea, pre) { padding: 8px 12px 12px; font-size: 1rem; line-height: 1.65; }
  .draft-foot { padding: 4px 14px 7px 8px; }
  .export { padding: 13px 15px; }
  .export .primary, .export .secondary { flex: 1; padding-inline: 8px; white-space: nowrap; }
  .export .visit { flex-basis: 100%; justify-content: center; min-height: 30px; }
  .guide { margin-top: 13px; }
  .guide-copy { margin-left: 0; }
}
@media (max-width: 370px) {
  .top-inner, .frame { width: calc(100% - 20px); }
  .top nav a { padding-inline: 5px; }
  .community .icon { display: none; }
  .tool { padding-inline: 4px; }
  .history { gap: 0; }
  .history .icon-button { width: 24px; }
}
@media (forced-colors: active) {
  .ink { visibility: hidden; }
  .editor.enhanced #roteiro { color: CanvasText; -webkit-text-fill-color: CanvasText; }
  .categories button[aria-pressed="true"], .choice[aria-pressed="true"] { border: 2px solid Highlight; }
}
