/* The share page in a browser: Clippy's own stylesheet (clippy.css, copied from the app at build time)
   plus what a web page needs on top: fonts, no window controls, form fields, the phone layout. */
@font-face { font-family: "Inter"; src: url(/fonts/inter-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url(/fonts/great-vibes.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Dancing Script"; src: url(/fonts/dancing-script.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Caveat"; src: url(/fonts/caveat.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Homemade Apple"; src: url(/fonts/homemade-apple.woff2) format("woff2"); font-display: swap; }

body { height: 100vh; height: 100dvh; }
#app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
a.btn { text-decoration: none; white-space: nowrap; color: var(--text); }
input.text, textarea.text, select.text {
  width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 0 10px; background: var(--surface); color: var(--text);
  transition: border-color var(--fast), box-shadow var(--fast); user-select: text;
}
textarea.text { height: auto; padding: 8px 10px; resize: vertical; }
input.text:focus, textarea.text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.err { color: var(--danger); font-size: 12px; min-height: 16px; margin-top: 8px; }
.err:empty { min-height: 0; margin: 0; }

/* ---------- Message screens (password, signed, errors) */
.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--canvas); overflow-y: auto; }
.center > .msgcard {
  width: 100%; max-width: 440px; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow-lg);
  display: block; animation: rise-in var(--slow) var(--ease-out);
}
.center > .msgcard:hover { background: var(--bg); }
.msgcard h1 { font-size: 17px; margin: 0 0 6px; }
.msgcard p { margin: 0 0 14px; color: var(--muted); line-height: 1.55; }
.msgcard .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
/* clippy.css's ".card .actions" is the hover toolbar on page thumbnails (hidden until hover, 26px icon buttons).
   Message cards are .card too, so their buttons (Continue, Open, Download) are put back to normal here. */
.center > .msgcard .actions { position: static; opacity: 1; transform: none; pointer-events: auto; background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
.center > .msgcard .actions .btn { width: auto; height: 34px; padding: 0 16px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: var(--r-sm); box-shadow: var(--shadow-xs); }
.center > .msgcard .actions .btn:hover { background: var(--hover); }
.center > .msgcard .actions .btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(60, 50, 180, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.center > .msgcard .actions .btn.primary:hover { background: var(--accent-hover); }
.center > .msgcard .actions .btn svg { width: 14px; height: 14px; }
@media (max-width: 760px) { .center > .msgcard .actions .btn { flex: 1 1 auto; height: 40px; } }
.msgcard .logo { width: 40px; display: block; margin-bottom: 14px; }

/* ---------- Titlebar: no window buttons to leave room for */
.titlebar.web { padding: 0 12px 0 16px; -webkit-app-region: no-drag; }
.titlebar.web .doc-title { min-width: 0; }
.titlebar.web .from { font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.titlebar.web .title-actions { min-width: 0; align-items: center; }
.titlebar.web .enc { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 2px; }
.titlebar.web .enc svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1100px) { .titlebar.web .from-mail { display: none; } }
@media (max-width: 760px) { .titlebar.web .enc span { display: none; } }
.titlebar.web .btn.dl svg { width: 14px; height: 14px; }

/* ---------- Pages */
.sign .reader { position: relative; scroll-behavior: auto; }
.page { flex: none; }
.page.blank canvas { background: #fff; }
.page .layer { position: absolute; inset: 0; z-index: 1; }
.page .layer.armed { cursor: crosshair; touch-action: none; }
.page .layer.armed .overlay { cursor: crosshair; }
.overlay.k-highlight { background: var(--hl, rgba(255, 224, 0, 0.45)); mix-blend-mode: multiply; }
.overlay.k-whiteout { background: #fff; }
.overlay.live { pointer-events: none; outline: 1px dashed var(--accent); }
.overlay svg.ink { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }
.ink-live { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ink-live path, .overlay svg.ink path { fill: none; stroke: #111; stroke-linecap: round; stroke-linejoin: round; }
.overlay.k-comment { display: flex; align-items: center; justify-content: center; background: #ffd45c; border-radius: 4px 4px 4px 1px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.overlay.k-comment svg { width: 70%; height: 70%; color: #5c4400; stroke-width: 1.6; }
.overlay .bubble {
  position: absolute; left: calc(100% + 8px); top: -2px; width: 220px; padding: 8px 10px; border-radius: 8px; background: var(--raised); color: var(--text);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-md); font-size: 12px; line-height: 1.45; white-space: pre-wrap; display: none; z-index: 4; pointer-events: none;
}
.overlay .bubble.left { left: auto; right: calc(100% + 8px); }
.overlay.k-comment:hover .bubble, .overlay.k-comment.active .bubble { display: block; }
.overlay .bubble:empty { display: none !important; }
.find-hit { position: absolute; background: rgba(255, 196, 0, 0.38); mix-blend-mode: multiply; border-radius: 1px; pointer-events: none; }
.find-hit.cur { background: rgba(255, 140, 0, 0.6); box-shadow: 0 0 0 1.5px rgba(255, 140, 0, 0.9); }
@media (pointer: coarse) {
  .overlay .handle { width: 22px; height: 22px; right: -11px; bottom: -11px; }
  .overlay .x { width: 28px; height: 28px; right: -14px; top: -14px; }
}
.overlay .handle { pointer-events: none; }
.overlay.active .handle { pointer-events: auto; touch-action: none; }
.comment-edit {
  position: absolute; z-index: 6; width: 240px; padding: 10px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  animation: fade-in var(--fast) var(--ease);
}
.comment-edit textarea { width: 100%; min-height: 70px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; resize: none; outline: none; user-select: text; }
.comment-edit .row { justify-content: flex-end; margin-top: 6px; }

/* Form fields in the document */
.fld { position: absolute; box-sizing: border-box; margin: 0; z-index: 2; }
input.fld, textarea.fld, select.fld { border: 1px solid rgba(108, 99, 230, 0.35); background: rgba(255, 255, 255, 0.96); border-radius: 2px; padding: 0 3px; font-family: "Inter", sans-serif; color: #111; resize: none; user-select: text; }
input.fld:focus, textarea.fld:focus, select.fld:focus { outline: 2px solid rgba(108, 99, 230, 0.2); border-color: #6c63e6; }
.fld.box { border: 1px solid rgba(108, 99, 230, 0.35); border-radius: 2px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fld.box.round { border-radius: 50%; }
.fld.box.changed { background: #fff; }
.fld.box svg { width: 80%; height: 80%; stroke: #111; stroke-width: 2.2; }
.fld.box .dot { width: 50%; height: 50%; border-radius: 50%; background: #111; }
.fld.spot { border: 1.5px dashed #6c63e6; background: rgba(108, 99, 230, 0.1); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #6c63e6; font-size: 12px; font-weight: 600; cursor: pointer; }
.fld.spot.filled { display: none; }
.fld.pulse { animation: pulse 1.2s ease 2; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(108, 99, 230, 0.2); } }

/* Zoom, bottom left of the document */
.zoombox {
  position: absolute; left: 16px; bottom: 16px; z-index: 4; display: inline-flex; align-items: center; height: 30px; padding: 0 2px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--raised); box-shadow: var(--shadow-sm);
}
.zoombox .icon-btn { width: 26px; height: 26px; }
.zoombox .zl { border: 0; background: none; min-width: 44px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0; }
.zoombox .zl:hover { color: var(--text); }
.sign-wrap { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; }
.sign-wrap .reader { flex: 1; min-height: 0; }
.reader.zoomed { align-items: flex-start; }
.reader.zoomed .page-wrap { margin: 0 auto; }

/* Hints and short messages, at the bottom of the document */
.hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; background: var(--toast-bg); color: #fff; border-radius: 12px; padding: 9px 16px;
  font-size: 12.5px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-lg); white-space: nowrap; max-width: calc(100% - 24px); animation: rise-in var(--mid) var(--ease-out);
}
.hint span { overflow: hidden; text-overflow: ellipsis; }
.hint button { border: 0; background: none; color: #c9c5ff; padding: 0; font-weight: 500; }
.hint.arm { display: none; }
.drag-hint .link-btn { padding: 0 2px; font-size: 12px; }
.drag-hint .grow { flex: 1; }

/* Thumbnails (as the app's, with the page in view marked) */
.thumbs .tcard { border: 0; background: none; padding: 0; }
.thumbs .tthumb canvas { display: block; }

/* ---------- Side panel */
.panel .note-from p { white-space: pre-wrap; color: var(--text); font-size: 12.5px; line-height: 1.5; }
.panel .note-from .muted { margin-bottom: 6px; display: block; font-size: 11.5px; }
.sig-item .tag { pointer-events: none; }
.sig-item .del { cursor: pointer; }
.sig-adds { display: flex; gap: 2px 10px; flex-wrap: wrap; margin: -2px 0 10px -4px; }
.sig-adds .link-btn { font-size: 12px; }
.panel .sec-note { font-size: 11px; color: var(--faint); line-height: 1.45; margin-top: auto; padding: 14px 16px 18px; }
.panel .grow { flex: 1; }
.firma-file { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.firma-file .btn { flex: none; }
.firma-file .fname { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#firmaBody .text { margin-bottom: 8px; }
.cert-status { font-size: 11.5px; color: var(--muted); margin: -2px 0 10px; line-height: 1.4; }
.cert-status:empty { display: none; }
.cert-status.bad { color: var(--danger); }
.firma-note { font-size: 11px; color: var(--faint); line-height: 1.45; margin-top: 2px !important; }
.btn.ai.busy { pointer-events: none; opacity: 0.6; }

/* ---------- Organize */
.organize-view { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--canvas); }
.organize-view .grid { flex: 1; overflow-y: auto; align-content: start; }
.organize-view .card { cursor: pointer; }
.organize-view .card .thumb { position: relative; background: #fff; box-shadow: var(--page-shadow); border-radius: 2px; transition: transform var(--mid) var(--ease-out), box-shadow var(--mid); }
.organize-view .card .pg { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.organize-view .card.selected .pg { color: var(--accent); font-weight: 600; }
.organize-view .card.drop-before { box-shadow: -3px 0 0 var(--accent); }
.organize-view .card.drop-after { box-shadow: 3px 0 0 var(--accent); }
.organize-view .card.dragging { opacity: 0.35; }

/* ---------- Dialogs (the app's modal) */
.modal .row.end { justify-content: flex-end; }
.modal .lbl { font-size: 12px; font-weight: 500; color: var(--muted); margin: 12px 0 6px; display: block; }
.modal .lbl:first-child { margin-top: 0; }
.modal .check { align-items: flex-start; line-height: 1.45; }
.modal .check input { margin-top: 2px; }
.modal .sides { display: flex; flex-direction: column; gap: 8px; }
.modal .sides .btn { justify-content: flex-start; height: 36px; }
.pad-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.typed-preview { height: 120px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; color: #111; display: flex; align-items: center; justify-content: center; font-family: "Great Vibes", cursive; font-size: 46px; overflow: hidden; white-space: nowrap; padding: 0 16px; }
.upload-box { cursor: pointer; }
.stamp-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.stamp-form > input:first-child, .stamp-form .row, .stamp-form .stamp-preview { grid-column: 1 / -1; }
.stamp-form .row { justify-content: space-between; margin: 2px 0; }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--c); padding: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); }
.swatches button.on, .swatches button.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--c); }
.hl-swatches button { width: 14px; height: 14px; }
.stamp-preview { height: 150px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; display: flex; align-items: center; justify-content: center; }
.stamp-preview img { max-width: 90%; max-height: 130px; }
.stamp-preview span { color: #6b6878; font-size: 12px; }
.digital-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--accent); border-radius: var(--r); background: var(--accent-soft); margin: 4px 0 12px; font-size: 12.5px; }
.digital-line svg { color: var(--accent); margin-top: 1px; }

/* ---------- Phones: the panel becomes a strip of tools at the bottom */
@media (max-width: 760px) {
  .titlebar.web { grid-template-columns: minmax(0, 1fr) auto; padding: 0 8px 0 12px; }
  .titlebar.web .from, .titlebar.web .doc-title .muted, .titlebar.web a.btn, #btnThumbs, .zoombox { display: none; }
  /* Organize / Sign & fill: a second row of the title bar */
  .titlebar.web { height: auto; padding-top: 6px; padding-bottom: 6px; row-gap: 6px; }
  .titlebar.web .segmented { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; display: flex; }
  .titlebar.web .segmented button { flex: 1; height: 30px; }
  .titlebar.web .btn.ai span, .titlebar.web .btn.dl span { display: none; }
  .titlebar.web .btn.ai, .titlebar.web .btn.dl { width: 30px; padding: 0; }
  .titlebar.web .history-btns { margin-right: 0; }
  .sign .thumbs { display: none; }
  .sign .reader { padding: 16px 10px 150px; gap: 18px; }
  .sign .panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; width: auto; height: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden;
    border-left: 0; border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 2px; background: var(--bg);
  }
  .panel .panel-section, .panel .add-grid, .panel .sig-list { display: contents; }
  .panel .panel-section.note-from, .panel h3, .panel .panel-head .link-btn, .panel .drag-hint, .panel .sec-note, .panel .grow, .panel #firmaBody { display: none !important; }
  .panel .sig-adds { display: contents; }
  .panel .sig-adds .link-btn { flex: none; height: 54px; min-width: 64px; padding: 4px 8px; font-size: 11px; color: var(--text); border-radius: 8px; }
  .panel .panel-head { display: contents; }
  .panel .tool.block, .panel .sig-item, .panel .sig-empty, .panel .switch-row {
    flex: none; flex-direction: column; width: auto; height: 54px; min-width: 64px; margin: 0; padding: 4px 6px; gap: 3px; font-size: 11px;
    border: 0; border-radius: 8px; justify-content: center; align-items: center; background: none; box-shadow: none; transform: none; animation: none;
  }
  .panel .tool.block kbd, .panel .sig-item .tag, .panel .sig-item .del, .panel .sig-item .grab, .panel .sig-empty b { display: none; }
  .panel .sig-item img { max-height: 26px; max-width: 64px; }
  .panel .sig-item::after { content: attr(data-label); font-size: 11px; color: var(--text); }
  .panel .sig-empty svg { width: 16px; height: 16px; }
  .panel .sig-empty::after { content: attr(data-label); font-size: 11px; color: var(--text); }
  .panel .switch-row .sw-text b { font-size: 11px; font-weight: 400; }
  .panel .switch-row { flex-direction: column-reverse; }
  .panel .switch { transform: scale(0.85); }
  .panel .tool.block.armed, .panel .sig-item.armed { background: var(--accent-soft); box-shadow: none; }
  .panel.more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
  .hint { position: fixed; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .hint.arm { display: flex; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92vh; }
  .modal.wide { width: 100%; }
  .stamp-form { grid-template-columns: minmax(0, 1fr); }
  .organize-view .toolbar { overflow-x: auto; }
  .organize-view .toolbar .tool span, .organize-view .zoom { display: none; }
  .organize-view .grid { --thumb: 120px !important; padding: 12px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .sign .thumbs { display: none; }
  #btnThumbs { display: none; }
  .sign .panel { width: 272px; }
}

/* Edit text: the text cursor over the page while the tool is on */
.reader.editing-text .page .layer.armed, .reader.editing-text .page .layer.armed .overlay { cursor: text; }
.overlay.para-ov .handle { display: none; }
/* Signature dialog, as the app's */
.modal .sig-options { margin-top: 14px; }
.modal .font-options { margin-top: 10px; }
.modal .type-input { margin-bottom: 0; }

/* Places to sign: a yellow tag beside each box, as DocuSign shows them */
.fld.spot[data-flag]::before {
  content: attr(data-flag); position: absolute; right: calc(100% + 6px); top: 50%; transform: translateY(-50%); white-space: nowrap;
  background: #ffd45c; color: #3d2f00; font: 600 10px/1 Inter, sans-serif; letter-spacing: 0.02em; text-transform: uppercase; padding: 5px 12px 5px 7px;
  border-radius: 3px 0 0 3px; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, 0 100%); box-shadow: 0 1px 2px rgba(0,0,0,.12);
  animation: flag-nudge 1.8s var(--ease) 0.4s 2;
}
@keyframes flag-nudge { 0%, 100% { transform: translate(0, -50%); } 50% { transform: translate(-4px, -50%); } }
.fld.spot { min-height: 18px; transition: background var(--fast), border-color var(--fast), transform var(--fast); }
.fld.spot:hover { background: rgba(108, 99, 230, 0.18); }
.fld.spot.suggest { border-style: dashed; }
.fld.spot.filled { display: none; }

/* ---------- Opening a link: the window's outline, shimmering, with the logo and what's happening */
.loading-win { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); animation: fade-in var(--mid) var(--ease); }
.sk { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 0%, var(--hover) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-title { height: 52px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.sk-title .grow { flex: 1; }
.sk-title .sk { height: 12px; }
.sk-logo { width: 22px; }
.sk-main { flex: 1; min-height: 0; display: flex; background: var(--canvas); }
.sk-thumbs { width: 132px; flex: none; border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 14px; }
.sk-thumb { width: 96px; height: 124px; border-radius: 2px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.sk-reader { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 32px 24px; gap: 22px; overflow: hidden; }
.sk-page { width: min(620px, 100%); aspect-ratio: 1 / 1.3; background: #fff; box-shadow: var(--page-shadow); border-radius: 2px; padding: 9% 10%; display: flex; flex-direction: column; gap: 12px; }
.sk-page .sk { height: 9px; background: linear-gradient(90deg, #eeebe6 0%, #f8f6f3 50%, #eeebe6 100%); background-size: 200% 100%; }
.sk-page br { display: block; content: ''; height: 10px; }
.sk-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.sk-mark { width: 26px; animation: sk-bob 1.6s var(--ease) infinite; }
@keyframes sk-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-6deg); } }
.sk-text:empty { display: none; }
.sk-panel { width: 300px; flex: none; border-left: 1px solid var(--line); background: var(--bg); padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.sk-card { height: 78px !important; border-radius: 12px !important; }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sk-tool { height: 36px !important; border-radius: 6px !important; }
@media (max-width: 760px) { .sk-thumbs, .sk-panel { display: none; } .sk-reader { padding: 16px 10px; } }
@media (min-width: 761px) and (max-width: 1100px) { .sk-thumbs { display: none; } }
@media (prefers-reduced-motion: reduce) { .sk, .sk-mark { animation: none; } }

/* Black boxes over hidden details (the words are removed when exported) */
.overlay.k-redact { background: #111; }
.lang-btn { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; width: auto; padding: 0 6px; }
/* Ask, and tell Clippy what to do (as the app's Ask box) */
.ask-section { display: flex; flex-direction: column; gap: 0; }
.ask-box { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
.ask-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ask-box .spark { width: 14px; height: 14px; color: var(--accent); fill: currentColor; stroke: none; }
.ask-box input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; outline: none; user-select: text; }
.ask-box input::placeholder { color: var(--faint); }
.ask-box.busy { opacity: 0.7; }
.ask-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ask-hints .chip { height: 26px; font-size: 11.5px; font-weight: 500; padding: 0 10px; }
.ask-list:empty { display: none; }
.ask-list { margin-top: 4px; }
.ask-item { padding: 12px 0 0; animation: rise-in var(--mid) var(--ease-out); }
.ask-item + .ask-item { border-top: 1px solid var(--line); margin-top: 12px; }
.ask-q { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; overflow-wrap: anywhere; }
.ask-a { font-size: 12.5px; line-height: 1.55; color: var(--text); user-select: text; overflow-wrap: anywhere; }
.ask-a.muted { color: var(--muted); }
.ask-loading { padding-top: 4px; }
.ask-cite { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; margin: 0 0 0 3px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1; vertical-align: 1px; }
.ask-cite:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.ask-change { margin: 4px 0; font-size: 12.5px; line-height: 1.5; }
.ask-change .to { color: var(--text); font-weight: 500; }
.ask-undo { padding: 2px 0; margin-top: 2px; font-size: 12px; }
.ask-note { font-size: 12px; color: var(--faint); margin-top: 2px; }
@media (max-width: 760px) { .panel .ask-section, .panel .summary { display: none !important; } }

/* Phones: the title keeps its room (logo, redo, language and Add files make way) */
@media (max-width: 760px) {
  .titlebar.web .app-logo, .titlebar.web .redo-btn, .titlebar.web .lang-btn, .titlebar.web .add-files { display: none; }
  .titlebar.web .doc-title { gap: 6px; }
  .titlebar.web #docName { font-size: 13.5px; }
  .titlebar.web .title-actions { gap: 4px; }
}

/* Phones and touch */
.ai-chip { display: none; }
.share-row { display: flex; gap: 8px; margin-top: 10px; }
.share-row .btn { flex: 1; height: 40px; }
.ai-sheet .ask-section, .ai-sheet .summary { display: block !important; padding: 0; border: 0; background: none; }
.ai-sheet .summary { margin-top: 18px; }
@media (max-width: 760px) {
  .titlebar.web .seg-ph { display: none; }
  .panel .ai-chip { display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 54px; min-width: 64px; padding: 4px 6px; border: 0; border-radius: 8px; background: none; font-size: 11px; color: var(--text); }
  .panel .ai-chip .spark { width: 16px; height: 16px; color: var(--accent); fill: currentColor; stroke: none; }
  .modal-body.ai-sheet { max-height: 70vh; overflow-y: auto; }
}
@media (pointer: coarse) {
  .swatches button { width: 30px; height: 30px; }
  .hl-swatches button, .tb-swatches button { width: 26px; height: 26px; }
  .tb-btn { height: 36px; padding: 0 10px; }
  .modal .check input, .radio-row input, .cert-export input { width: 20px; height: 20px; }
  .modal .link-btn, .drag-hint .link-btn { padding: 8px 6px; }
  .zoombox .icon-btn { width: 34px; height: 34px; }
  .ask-cite { min-width: 26px; height: 22px; }
}

.modal .sig-options { flex-wrap: wrap; row-gap: 10px; }

/* ---------------------------------------------------------------- /verify: check a signed document */
.center.vf { min-height: 100vh; }
.center > .msgcard.vf-card { max-width: 520px; }
.vf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.vf-head h1 { margin: 0; flex: 1; }
.vf-logo { width: 22px; height: 22px; border-radius: 6px; }
.vf-lang { flex: none; }
.vf-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); cursor: pointer; text-align: center; color: var(--muted); transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease); }
.vf-drop:hover, .vf-drop.over, .vf-drop:focus-visible { background: var(--hover); border-color: var(--accent); outline: none; }
.vf-drop svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.vf-drop strong { color: var(--text); font-weight: 600; font-size: 14px; }
.vf-drop span { font-size: 13px; }
.vf-result:empty { display: none; }
.vf-result { margin-top: 18px; }
.vf-busy { margin: 0; color: var(--muted); }
.vf-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); }
.vf-status svg { flex: none; width: 20px; height: 20px; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.vf-status strong { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.vf-status span { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.vf-status.ok svg { stroke: var(--success); }
.vf-status.none svg { stroke: var(--warn); }
.vf-status.bad strong { color: var(--danger); }
.vf-rows { margin-top: 12px; }
.vf-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.vf-row:first-child { border-top: 0; }
.vf-label { color: var(--muted); }
.vf-value { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.vf-value code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.02em; }
.vf-when { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.vf-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 11px; line-height: 18px; }
@media (max-width: 520px) { .center > .msgcard.vf-card { padding: 20px; } .vf-row { grid-template-columns: 90px 1fr; } }

