/* Splicio Desk: matte dark studio. One accent (acid lime) for the main action on each screen. */
@font-face { font-family: Inter; src: url(/fonts/inter-400-700.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Sig; src: url(/fonts/dancing-script-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --bg: #000; --card: #141414; --card2: #1b1b1b; --line: #262626; --line2: #333; --text: #f2f2f2; --muted: #8f8f8f; --dim: #5f5f5f;
  --lime: #d3fb54; --lime-ink: #0a0a0a; --lime-dim: rgba(211, 251, 84, .12);
  --red: #ff6b6b; --blue: #5fb0ff; --purple: #b994ff; --ok: #7ee08a; --warn: #ffc857;
  --r: 14px; --r-sm: 10px; --pad: 16px; --top: 60px; --bottom: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lime); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 18px; padding: 0 var(--pad);
  padding-top: env(safe-area-inset-top); background: rgba(0, 0, 0, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--lime); position: relative; }
.brand .mark::after { content: ''; position: absolute; inset: 6px 5px; border-left: 3px solid var(--lime-ink); border-right: 3px solid var(--lime-ink); transform: skewX(-14deg); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs button, .bottom button { background: none; border: 0; cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.tabs button { padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-current='page'] { color: var(--text); background: var(--card2); }
.tabs svg { width: 17px; height: 17px; }
.soon { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line2); border-radius: 999px; padding: 0 6px; }
.me { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line2); background: var(--card2) center/cover; cursor: pointer; padding: 0; font-weight: 700; }
credits-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
credits-badge b { color: var(--text); }
credits-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
credits-badge[data-low] .dot { background: var(--warn); }
credits-badge[data-out] .dot { background: var(--red); }
.bottom { display: none; }

main { max-width: 1000px; margin: 0 auto; padding: 22px var(--pad) calc(40px + var(--bottom)); }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.03em; margin: 4px 0 6px; }
h2 { font-size: 17px; letter-spacing: -.01em; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.lead { color: var(--muted); margin: 0 0 20px; max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* cards and controls */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card, .stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line2); background: var(--card2); color: var(--text);
  border-radius: 999px; padding: 10px 16px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #444; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line2); background: transparent; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip:hover { color: var(--text); }
.chip[aria-pressed='true'] { color: var(--lime-ink); background: var(--lime); border-color: var(--lime); }
input[type=text], input[type=number], input[type=url], select, textarea { background: #0c0c0c; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #555; }
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
label.f { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hr { height: 1px; background: var(--line); margin: 16px 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; border: 1px solid var(--line2); color: var(--muted); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }

/* drop zone */
.drop { border: 1.5px dashed #3a3a3a; border-radius: var(--r); padding: 34px 18px; text-align: center; cursor: pointer; background: #0a0a0a; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--lime); background: var(--lime-dim); }
.drop b { display: block; font-size: 17px; margin-bottom: 4px; }
.drop .icon { width: 38px; height: 38px; margin: 0 auto 10px; color: var(--lime); }

/* file list */
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.files li:last-child { border-bottom: 0; }
.files .ext { width: 40px; height: 40px; border-radius: 9px; background: var(--card2); border: 1px solid var(--line2); display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .04em; flex: none; }
.files .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .meta { font-size: 12px; color: var(--muted); }
.iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--muted); flex: none; padding: 0; }
.iconbtn:hover { color: var(--text); border-color: var(--line2); }
.iconbtn svg { width: 15px; height: 15px; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tool { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; }
.tool:hover { border-color: #3d3d3d; }
.tool svg { width: 22px; height: 22px; color: var(--lime); }
.tool b { display: block; margin-top: 10px; font-size: 14px; }
.tool span { font-size: 12px; color: var(--muted); }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--lime); width: 0; transition: width .2s; }

/* write */
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 6px; }
.mic { width: 108px; height: 108px; border-radius: 50%; border: 0; background: var(--lime); color: var(--lime-ink); cursor: pointer; display: grid; place-items: center; position: relative; }
.mic svg { width: 40px; height: 40px; }
.mic.rec { background: var(--red); color: #fff; }
.mic.rec::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--red); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { from { transform: scale(.92); opacity: 1; } to { transform: scale(1.18); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mic.rec::before { animation: none; } }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-height: 20px; }
.editor { position: relative; border: 1px solid var(--line); border-radius: var(--r-sm); background: #0c0c0c; }
.editor .backdrop, .editor textarea { font: 16px/1.65 Inter, system-ui, sans-serif; padding: 16px; margin: 0; border: 0; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; letter-spacing: 0; }
.editor .backdrop { position: absolute; inset: 0; overflow: hidden; color: transparent; pointer-events: none; border-radius: var(--r-sm); }
.editor textarea { position: relative; display: block; width: 100%; min-height: 320px; background: transparent; resize: vertical; border-radius: var(--r-sm); caret-color: var(--lime); overflow: auto; }
.editor textarea:focus { outline: none; }
.editor mark { color: transparent; background: none; border-bottom: 2px solid; padding-bottom: 1px; }
.editor mark.sp, .editor mark.grammar { border-color: var(--red); }
.editor mark.clarity { border-color: var(--blue); }
.editor mark.tone { border-color: var(--purple); }
.editor mark.sel { border-color: var(--lime); background: var(--lime-dim); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span::before { content: ''; display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 5px; background: currentColor; }
.legend .r { color: var(--red); } .legend .b { color: var(--blue); } .legend .p { color: var(--purple); }
.pop { position: fixed; z-index: 40; background: #1c1c1c; border: 1px solid var(--line2); border-radius: 12px; padding: 12px; width: min(300px, calc(100vw - 24px)); box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.pop .kind { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pop .fix { margin: 6px 0 4px; font-weight: 600; }
.pop .fix del { color: var(--muted); }
.pop .why { font-size: 12px; color: var(--muted); }
.issues { list-style: none; padding: 0; margin: 0; }
.issues li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.issues li:last-child { border: 0; }
.issues .bar { width: 3px; align-self: stretch; border-radius: 3px; flex: none; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-list li:last-child { border: 0; }
.st { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--lime-ink); }
.st.met { background: var(--ok); } .st.partial { background: var(--warn); } .st.missing { background: var(--red); }
.cite-out { background: #0c0c0c; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; padding-left: 2.2em; text-indent: -1.4em; line-height: 1.6; }
details.more > summary { cursor: pointer; list-style: none; font-weight: 600; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: '+'; float: right; color: var(--muted); }
details.more[open] > summary::after { content: '\2212'; }

/* sign editor */
.pdf-pages { display: flex; flex-direction: column; gap: 16px; align-items: center; padding: 14px 0; }
.pg { position: relative; box-shadow: 0 0 0 1px var(--line2); background: #fff; touch-action: pan-y; }
.pg canvas { display: block; width: 100%; height: auto; }
.pg .layer { position: absolute; inset: 0; }
.pg.mode-redact .layer, .pg.mode-text .layer, .pg.mode-sign .layer, .pg.mode-date .layer, .pg.mode-check .layer { cursor: crosshair; }
.it { position: absolute; border: 1px dashed transparent; touch-action: none; }
.it.on { border-color: var(--lime); }
.it .txt { color: #111; font-family: Helvetica, Arial, sans-serif; white-space: pre; outline: none; min-width: 20px; line-height: 1.2; }
.it img { display: block; width: 100%; height: 100%; pointer-events: none; }
.it.redact { background: #000; }
.it .x { position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-weight: 800; cursor: pointer; display: none; line-height: 24px; padding: 0; }
.it .rz { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 4px; background: var(--lime); display: none; cursor: nwse-resize; touch-action: none; }
.it.on .x, .it.on .rz { display: block; }
.signbar { position: sticky; top: calc(var(--top) + 8px); z-index: 10; background: rgba(20, 20, 20, .95); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 999px; padding: 6px; display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.signbar .chip { border: 0; }
.pad { width: 100%; height: 180px; background: #fff; border-radius: var(--r-sm); touch-action: none; display: block; }
.sig-typed { font: 700 44px Sig, cursive; color: #111; background: #fff; border-radius: var(--r-sm); padding: 18px; text-align: center; min-height: 100px; }

/* sheet, toasts */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; }
.sheet-card { background: var(--card); border: 1px solid var(--line2); border-radius: 18px; padding: 20px; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + var(--bottom)); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { background: #1f1f1f; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 14px; font-size: 14px; max-width: 460px; pointer-events: auto; }
.toast.err { border-color: rgba(255, 107, 107, .5); }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.soon-card { text-align: center; padding: 40px 20px; }
.soon-card svg { width: 40px; height: 40px; color: var(--lime); }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  :root { --top: 54px; --bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabs { display: none; }
  .bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: rgba(0, 0, 0, .94); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom button { flex-direction: column; gap: 3px; font-size: 10.5px; font-weight: 600; padding: 4px 2px; min-width: 56px; }
  .bottom button svg { width: 22px; height: 22px; }
  .bottom button[aria-current='page'] { color: var(--lime); }
  main { padding-top: 16px; }
  h1 { font-size: 24px; }
  .grid2 { grid-template-columns: 1fr; }
  .editor .backdrop, .editor textarea { font-size: 16px; padding: 14px; }
  .card { padding: 15px; }
  .toolbar .legend { flex: 1 1 100%; order: 2; }
}
