@font-face { font-family: Poppins; src: url("assets/poppins-500.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: Poppins; src: url("assets/poppins-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Poppins; src: url("assets/poppins-700.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Noto Sans KR"; src: url("assets/noto-kr.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --text-font: Poppins, "Noto Sans KR", sans-serif;
  --writing-line-height: 34px;
}
body { min-height: 100svh; font: 500 13px/1.5 var(--text-font); -webkit-font-smoothing: antialiased; }
button { appearance: none; background: transparent; border: 0; border-radius: 0; padding: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.column { width: min(910px,calc(100% - 44px)); margin-inline: auto; }
.edition-banner { position: relative; height: 29px; display: grid; place-items: center; color: white; background: #ff5224; }
.edition-banner a { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; line-height: 1.2; }
.edition-banner a:hover, .context-bar a:hover, .nav-links button:not(.icon):hover, .nav-links a:hover { text-decoration: underline; }
.banner-close { position: absolute; right: clamp(10px,2vw,28px); top: 0; width: 24px; height: 100%; display: grid; place-items: center; }
.banner-close svg { width: 15px; height: 15px; }
.topnav { display: flex; align-items: center; justify-content: space-between; height: 46px; margin-top: 30px; }
.logotype { font: 500 19px/1 var(--text-font); letter-spacing: -.6px; }
.logotype strong { font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: clamp(16px,2.2vw,28px); font-size: 13px; font-weight: 600; }
.nav-links button, .nav-links a { min-height: 32px; display: inline-flex; align-items: center; }
.icon { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 30px; }
.mode-button svg { width: 18px; height: 18px; stroke-width: 2; }
.sound-toggle svg { width: 15px; height: 15px; }
.sound-toggle[aria-pressed="true"] .sound-off, .sound-toggle[aria-pressed="false"] .sound-on { display: none; }
.workspace { margin-top: clamp(54px,calc((100svh - 125px) * .2),200px); margin-bottom: 36px; }
.context-bar { height: 16px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-bottom: 16px; }
.context-bar button, .context-bar a { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; font-weight: 600; font-size: 12px; }
.context-bar svg { width: 13px; height: 13px; }
.play-arrow { display: inline-block; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 8px solid currentColor; }
.writing-area { display: flex; flex-direction: column; border-top: 1px solid var(--line); min-height: 220px; height: clamp(220px,44svh,410px); padding: 14px 0 8px; }
#words, #editor { font: 400 23px/var(--writing-line-height) var(--text-font); letter-spacing: -.35px; }
#words { color: light-dark(#737373,#ababab); margin: 0; word-break: keep-all; }
#editor {
  display: block; flex: 1; width: 100%; min-height: 94px; padding: 0; margin: 4px 0 0;
  resize: none; border: 0; border-radius: 0; outline: 0; color: var(--fg); background: transparent;
  caret-color: var(--fg); scrollbar-color: var(--line) transparent; scrollbar-width: thin;
}
#editor::placeholder { color: light-dark(#8d8d8d,#888); opacity: 1; }
.article-tools, .result-tools { display: flex; align-items: flex-start; min-height: 62px; gap: 14px; border-top: 1px solid var(--fg); padding-top: 15px; }
.pager { display: inline-flex; gap: 4px; padding-top: 1px; }
.pager button { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 1px solid light-dark(#9e9e9e,#090909); border-radius: 50%; }
.pager button:not(:disabled):hover, .tool-icons button:not(:disabled):hover { background: var(--soft); }
.pager svg { width: 15px; height: 15px; }
.pager button:disabled, .tool-icons button:disabled { opacity: .4; }
.attribution { font-size: 12px; line-height: 19px; }
.attribution strong { font-size: 14px; }
.attribution div { color: var(--muted); }
.attribution i { display: inline-block; margin: 0 8px; height: 9px; border-left: 1px solid var(--muted); }
.tool-icons { display: flex; align-items: center; gap: 15px; margin-left: auto; margin-top: -3px; }
.tool-icons button { width: 35px; height: 30px; }
.tool-icons svg { width: 18px; height: 18px; }
.result-area { min-height: clamp(220px,44svh,410px); padding: 14px 0 27px; border-top: 1px solid var(--line); }
#receipt-focus { font-size: 14px; margin: 0 0 9px; outline: none; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
#receipt-text, #receipt-playback { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 23px; font-weight: 400; line-height: 1.5; }
.result-tools button { font-weight: 600; }
.result-tools button:hover, .tools-list button:hover { text-decoration: underline; }
#receipt-length { color: var(--muted); font-size: 12px; }
.result-exports { display: flex; gap: 20px; margin-left: auto; }
dialog { width: min(340px,calc(100% - 40px)); padding: 21px; margin: auto; color: var(--fg); background: var(--bg); border: 1px solid var(--fg); }
dialog::backdrop { background: rgb(0 0 0 / .23); }
.dialog-heading, .setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-heading { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-size: 16px; margin: 0; }
.setting-row { min-height: 47px; font-size: 13px; }
.setting-row button, .tools-list button { font-size: 12px; font-weight: 600; min-height: 32px; padding: 0 6px; }
.setting-row label small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; }
.setting-row select { max-width: 55%; min-height: 32px; padding: 0 6px; font: inherit; font-size: 12px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 2px; }
.prompt-value { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: -8px; padding-bottom: 10px; color: var(--muted); font-size: 12px; }
.prompt-value button { font-size: 12px; font-weight: 600; min-height: 28px; text-decoration: underline; text-underline-offset: 3px; }
.prompt-note, .pieces-note, .pieces-empty { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.pieces-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: min(52vh, 420px); overflow-y: auto; scrollbar-width: thin; }
.piece-row { display: flex; align-items: flex-start; gap: 6px; border-top: 1px solid var(--line); }
.piece-open { flex: 1; min-width: 0; display: block; padding: 10px 0; text-align: left; }
.piece-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 1.4; }
.piece-date, .piece-meta { color: var(--muted); font-size: 11px; }
.piece-excerpt { display: block; margin-top: 3px; font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece-open:hover .piece-excerpt { text-decoration: underline; text-underline-offset: 3px; }
.piece-meta { display: block; margin-top: 3px; }
.piece-delete { flex: none; min-height: 32px; margin-top: 7px; padding: 0 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.piece-delete:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.pieces-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--fg); color: var(--muted); font-size: 12px; }
.pieces-footer button { min-height: 32px; color: var(--fg); font-size: 12px; font-weight: 600; }
.pieces-footer button:disabled { opacity: .45; }
.pieces-footer button:not(:disabled):hover { text-decoration: underline; text-underline-offset: 3px; }
.receipt-kept { color: var(--muted); font-size: 11px; }
.result-tools .receipt-kept { padding-top: 1px; }
.attribution .prompt-line { margin-left: .4em; font-size: 12px; }
.setting-buttons, .tools-list { display: flex; align-items: center; gap: 8px; }
.setting-row button:hover { text-decoration: underline; }
.tools-list { padding-top: 10px; justify-content: space-between; }
@media (max-width: 650px) {
  :root { --writing-line-height: 25px; }
  .column { width: calc(100% - 40px); }
  .topnav { margin-top: 13px; }
  .nav-links { gap: 14px; font-size: 12px; }
  .nav-reroll, .nav-settings { display: none !important; }
  .nav-links .icon { min-width: 22px; }
  .workspace { margin-top: clamp(42px,12svh,100px); }
  .context-bar { margin-bottom: 11px; gap: 12px; }
  .context-bar button, .context-bar a { font-size: 11px; }
  .writing-area { height: clamp(195px,39svh,340px); min-height: 195px; padding-top: 13px; }
  #words, #editor, #receipt-text, #receipt-playback { font-size: 17px; line-height: var(--writing-line-height); letter-spacing: -.1px; }
  .article-tools { gap: 8px; flex-wrap: wrap; padding-top: 11px; }
  .pager button { height: 27px; width: 27px; }
  .attribution { flex: 1; min-width: 110px; line-height: 17px; }
  .attribution strong { font-size: 13px; }
  .attribution div { font-size: 10px; }
  .attribution i { margin: 0 4px; }
  .tool-icons { gap: 3px; }
  .tool-icons button { width: 25px; min-width: 25px; }
  .tool-icons svg { width: 15px; height: 15px; }
  .result-area { min-height: 195px; }
}
@media (max-width: 480px) and (max-height: 550px) {
  .workspace { margin-top: 18px; }
  .writing-area { min-height: 118px; height: 32svh; }
  #editor { min-height: 70px; }
}
