.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 20px; }
.hero-links a { font-size: .91rem; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: clip; }
.sheet-header, #worksheet-form, .sheet-results { padding: clamp(18px,3vw,34px); }
.sheet-header, .sheet-result-head, .sheet-entries-head, .sheet-controls, .sheet-upload, .reply-details {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px 15px;
}
.sheet-header { border-bottom: 1px solid var(--line); }
.sheet-header h2 { max-width: 33ch; font-size: clamp(1.55rem,3vw,2.43rem); }
.sheet-header p { margin-top: 8px; color: var(--muted); max-width: 70ch; }
.sheet-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px 17px; }
.sheet-span { grid-column: 1/-1; }
.sheet-subhead { margin-bottom: 12px; }
.sheet-entries-head { margin-top: 22px; }
.sheet-entries-head:first-child { margin-top: 0; }
.sheet-entries-head .sheet-subhead { margin-bottom: 0; }
.sheet-field { min-width: 0; }
.sheet-field label { display: block; font-weight: 600; margin-bottom: 5px; line-height: 1.3; font-size: .9rem; }
.sheet-field small, .sheet-note, .sheet-privacy { display: block; color: var(--muted); font-size: .82rem; line-height: 1.44; }
.sheet-field small { margin-top: 5px; }
.sheet-entry { position: relative; }
.sheet-entry input, .sheet-entry select, .sheet-entry textarea, .reply-card textarea {
  min-width: 0; min-height: 43px; width: 100%; padding: 8px 10px; border: 1px solid #cbc8bf; border-radius: 5px; background: #fff; color: var(--ink);
}
.sheet-entry.money input { padding-inline-start: 25px; }
.sheet-entry.percent input { padding-inline-end: 27px; }
.sheet-unit { position: absolute; inset-inline-start: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.sheet-unit.end { inset-inline-start: auto; inset-inline-end: 9px; }
.sheet-button {
  min-height: 42px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 7px 11px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font-size: .88rem;
  font-weight: 600; line-height: 1.2; text-decoration: none;
}
.sheet-button.quiet { border-color: #c5c1b7; background: #fff; }
.sheet-button.quiet:hover { background: #f0eee8; }
.sheet-button.solid { background: var(--ink); color: #fff; }
.sheet-button.solid:hover { background: #2c2c30; }
.sheet-button.clear:hover { text-decoration: underline; }
.sheet-button:disabled { opacity: .46; cursor: default; }
.sheet-upload .sheet-button { position: relative; cursor: pointer; }
.sheet-upload .sheet-button:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.sheet-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sheet-row { border: 1px solid var(--line); border-radius: 7px; margin-top: 10px; padding-inline: 12px; }
.sheet-row[open] { padding-bottom: 12px; }
.sheet-row summary, .quick-calculator > summary { font-weight: 600; cursor: pointer; padding-block: 10px; min-height: 44px; overflow-wrap: anywhere; }
.sheet-row[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.sheet-remove, #worksheet-add, .sheet-privacy { margin-top: 10px; }
.sheet-controls { margin-top: 18px; justify-content: flex-start; }
.sheet-issue { padding: 9px 11px; color: #641f15; background: #fff4ef; border: 1px solid #bc8177; border-radius: 5px; margin-top: 12px; }
.sheet-results { background: #f0eee8; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.sheet-result-head { padding-bottom: 12px; border-bottom: 1px solid #d4d1c9; justify-content: flex-start; }
.sheet-result-head h3 { font-size: 1.12rem; }
.sheet-result-head [role=status] { color: var(--muted); font-size: .81rem; }
.sheet-result-head #worksheet-actions { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 5px; }
.sheet-hint { margin-top: 14px; max-width: 69ch; color: var(--muted); }
.sheet-finding { margin-top: 18px; max-width: 37ch; font-size: clamp(1.34rem,2.7vw,2rem); line-height: 1.18; }
.sheet-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,182px),1fr)); gap: 12px; margin: 16px 0; }
.sheet-metrics > div { padding: 11px 0; border-block: 1px solid #d4d1c9; min-width: 0; }
.sheet-metrics dt { font-size: .8rem; color: var(--muted); }
.sheet-metrics dd { font-size: clamp(1.04rem,2.4vw,1.42rem); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sheet-table-wrap { background: #fff; border: 1px solid #d4d1c9; border-radius: 6px; overflow: hidden; }
.sheet-table { border-collapse: collapse; width: 100%; table-layout: auto; }
.sheet-table caption { text-align: left; padding: 10px 11px; font-size: .83rem; font-weight: 600; }
.sheet-table th, .sheet-table td { padding: 9px 10px; text-align: start; border-top: 1px solid var(--line); line-height: 1.35; font-size: .82rem; overflow-wrap: anywhere; }
.sheet-table thead th { background: #f7f6f2; color: var(--muted); vertical-align: bottom; }
.sheet-table td { font-variant-numeric: tabular-nums; }
.sheet-note { margin-top: 13px; }
.sheet-figure { padding: 13px; border: 1px solid #d4d1c9; border-radius: 6px; background: #fff; margin: 14px 0; }
.sheet-figure figcaption { font-size: .89rem; font-weight: 600; margin-bottom: 8px; }
.sheet-bar + .sheet-bar { margin-top: 7px; }
.sheet-bar-label, .interval-points { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 13px; flex-wrap: wrap; font-size: .8rem; }
.sheet-bar-track, .sheet-interval { position: relative; margin-top: 3px; height: 8px; background: #eeece6; }
.sheet-bar-mark { background: var(--ink); position: absolute; top: 0; height: 100%; }
.sheet-bar-mark.loss { background: repeating-linear-gradient(135deg,#88868a 0,#88868a 2px,#e5e3dc 2px,#e5e3dc 4px); }
.sheet-bar-zero { position: absolute; height: 13px; width: 1px; background: #88868a; top: -2px; }
.sheet-interval { margin: 15px 5px 10px; height: 13px; }
.interval-range { height: 100%; position: absolute; background: #a5a3a1; }
.interval-estimate { position: absolute; width: 9px; height: 9px; top: 2px; background: var(--ink); transform: translateX(-50%); border-radius: 50%; }
.interval-target { position: absolute; width: 2px; height: 19px; top: -3px; background: var(--ink); }
.interval-points span { font-variant-numeric: tabular-nums; }
.reply-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,245px),1fr)); gap: 12px; }
.reply-card { min-width: 0; padding: 13px; border: 1px solid #d4d1c9; border-radius: 7px; background: #fff; }
.reply-card label { display: block; font-weight: 600; line-height: 1.25; }
.reply-card p { color: var(--muted); font-size: .81rem; margin: 4px 0 8px; }
.reply-details { margin-top: 6px; font-size: .78rem; }
.quick-calculator { margin-top: 18px; border-bottom: 1px solid var(--line); }
.quick-calculator[open] > summary { margin-bottom: 10px; }
.quick-calculator[open] .workspace { padding-bottom: 16px; }

@media (max-width: 900px) {
  .sheet-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sheet-table th, .sheet-table td { padding-inline: 7px; }
}
@media (max-width: 640px) {
  .sheet-table { display: block; }
  .sheet-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sheet-table caption, .sheet-table tbody, .sheet-table tr { display: block; }
  .sheet-table tr { padding: 7px 10px 9px; border-top: 1px solid var(--line); }
  .sheet-table tbody th { display: block; padding: 5px 0; border: none; font-size: .92rem; }
  .sheet-table td { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.85fr); gap: 8px; padding: 4px 0; border: none; text-align: end; }
  .sheet-table td::before { content: attr(data-label); color: var(--muted); text-align: start; }
  .sheet-result-head #worksheet-actions { margin-inline-start: 0; }
}
@media (max-width: 420px) {
  .sheet-grid { grid-template-columns: minmax(0,1fr); }
  .sheet-controls .solid { width: 100%; }
}
