:root {
  --ink: #171a18;
  --paper: #ecebe4;
  --paper-2: #f5f3ed;
  --line: #c8c8bf;
  --muted: #70756f;
  --signal: #ef5a31;
  --green: #315e4d;
  --cream: #fffaf0;
  --serif: var(--sv-font-sans);
  --sans: var(--sv-font-sans);
  --mono: var(--sv-font-mono);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { font-family: var(--sans); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .15; z-index: 20; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); }

.invite-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: linear-gradient(115deg, #d9ddd5 0 48%, var(--sv-color-surface-hover) 48% 100%); }
.invite-card { position: relative; width: min(780px, 100%); min-height: 520px; padding: 56px 62px 46px; border: 1px solid rgba(255,255,255,.35); background: var(--paper-2); box-shadow: 0 34px 100px rgba(0,0,0,.28); }
.invite-card::after { content: "INVITATION"; position: absolute; right: -74px; top: 150px; color: var(--sv-color-text-faint); font: 11px/1 var(--mono); letter-spacing: .38em; transform: rotate(90deg); }
.invite-mark { display: flex; align-items: center; gap: 14px; margin-bottom: 70px; }
.invite-mark span, .brand > span { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--ink); font: 800 12px/1 var(--mono); letter-spacing: -.05em; }
.invite-mark i { display: block; width: 82px; height: 1px; background: var(--ink); }
.eyebrow, .workspace-head p, .section-number, .label-panel header p, .preview-pane header p { margin: 0; font: 10px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.invite-card h1 { max-width: 610px; margin: 18px 0 20px; font: 500 clamp(36px, 6vw, 70px)/.98 var(--serif); letter-spacing: -.05em; }
.invite-copy { max-width: 590px; color: var(--sv-color-text-faint); font-size: 15px; line-height: 1.8; }
.invite-facts { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; margin: 42px 0 34px; padding: 20px 0; border-block: 1px solid var(--line); }
.invite-facts div { min-width: 0; }
.invite-facts dt { margin-bottom: 9px; color: var(--muted); font: 9px/1 var(--mono); letter-spacing: .14em; }
.invite-facts dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.invite-form label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.invite-input-row { display: grid; grid-template-columns: 1fr auto; }
.invite-input-row input { min-width: 0; height: 52px; padding: 0 16px; border: 1px solid var(--ink); border-right: 0; background: transparent; outline: 0; }
.invite-input-row input:focus { box-shadow: inset 0 0 0 2px var(--signal); }
.invite-input-row button { min-width: 210px; border: 1px solid var(--ink); background: var(--ink); color: white; padding: 0 20px; cursor: pointer; font-weight: 700; }
.invite-input-row button:hover { background: var(--signal); border-color: var(--signal); }
.invite-form > p { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.notice { margin-top: 24px; padding: 14px; border-left: 3px solid var(--signal); background: #ffe7df; color: #7f2b13; font-size: 13px; }
.join-card { min-height: 650px; }
.join-card .invite-mark { margin-bottom: 48px; }
.join-form { display: grid; grid-template-columns: 1fr; gap: 9px; max-width: 590px; margin-top: 34px; }
.join-form label { margin-top: 8px; font-size: 11px; font-weight: 800; }
.join-form input { width: 100%; height: 50px; padding: 0 15px; border: 1px solid var(--ink); border-radius: 0; background: transparent; outline: 0; }
.join-form input:focus { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); }
.join-form .access-code-input { height: 64px; font: 700 26px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.join-form button { min-height: 52px; margin-top: 12px; border: 1px solid var(--ink); background: var(--ink); color: white; cursor: pointer; font-weight: 800; }
.join-form button:hover:not(:disabled) { background: var(--signal); border-color: var(--signal); }
.join-form button:disabled { opacity: .5; cursor: wait; }
.join-form > p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.workspace { min-height: 100vh; }
.workspace-head { display: grid; grid-template-columns: 220px 1fr auto; align-items: center; min-height: 112px; padding: 20px 34px; border-bottom: 1px solid var(--ink); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand b { font: 700 9px/1.2 var(--mono); letter-spacing: .13em; }
.task-title { min-width: 0; }
.task-title h1 { margin: 7px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 30px/1 var(--serif); }
.member-chip { display: grid; gap: 4px; text-align: right; }
.member-chip span { color: var(--muted); font: 9px/1 var(--mono); letter-spacing: .13em; }
.member-chip b { font-size: 13px; }
.task-strip { display: grid; grid-template-columns: 145px 1fr 180px; align-items: center; gap: 28px; min-height: 92px; padding: 18px 34px; background: var(--ink); color: var(--cream); }
.progress-copy span { font: 500 25px/1 var(--serif); }
.progress-copy p { margin: 5px 0 0; color: var(--sv-color-text-muted); font-size: 10px; }
.progress-track { height: 2px; background: #484d49; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--signal); transition: width .35s ease; }
.deadline { padding-left: 28px; border-left: 1px solid #454b47; }
.deadline span { display: block; color: var(--sv-color-text-muted); font: 9px/1 var(--mono); letter-spacing: .14em; }
.deadline b { display: block; margin-top: 8px; font: 400 13px/1 var(--mono); }
.contact-sheet { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 204px); }
.sheet-aside { display: flex; flex-direction: column; padding: 34px; border-right: 1px solid var(--ink); background: #dedfd7; }
.sheet-aside h2 { margin: 16px 0 22px; font: 500 42px/.95 var(--serif); letter-spacing: -.04em; }
.sheet-aside > p:not(.section-number) { margin: 0 0 34px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.filters { display: grid; border-top: 1px solid #aeb1aa; }
.filters button { display: flex; justify-content: space-between; padding: 14px 0; border: 0; border-bottom: 1px solid #aeb1aa; background: transparent; cursor: pointer; font-size: 12px; text-align: left; }
.filters button::before { content: ""; width: 7px; height: 7px; margin-top: 5px; border: 1px solid #7b807b; border-radius: 50%; }
.filters button.active::before { background: var(--signal); border-color: var(--signal); }
.filters button b { margin-left: auto; color: var(--muted); font: 10px/1.6 var(--mono); }
.privacy-note { display: flex; gap: 10px; margin-top: auto; padding-top: 32px; color: var(--sv-color-text-faint); font-size: 10px; line-height: 1.55; }
.privacy-note i { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 3px; background: var(--green); border-radius: 50%; }
.privacy-note p { margin: 0; }
.sheet-main { min-width: 0; padding: 26px 30px 50px; }
.sheet-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-bottom: 22px; }
.sheet-toolbar p { margin: 0; color: var(--muted); font: 9px/1 var(--mono); letter-spacing: .15em; }
.sheet-toolbar label { display: flex; align-items: center; border-bottom: 1px solid #999e98; }
.sheet-toolbar label span { color: var(--muted); font-size: 10px; }
.sheet-toolbar input { width: 170px; height: 32px; border: 0; background: transparent; padding: 0 8px; outline: 0; }
.sheet-batch { justify-self: end; display: flex; align-items: stretch; }
.sheet-batch[hidden] { display: none; }
.sheet-batch button { min-height: 34px; padding: 0 12px; border: 1px solid #999e98; background: transparent; color: var(--ink); cursor: pointer; font-size: 10px; }
.sheet-batch button + button { border-left: 0; }
.sheet-batch button:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: white; }
.sheet-batch button:disabled { opacity: .38; cursor: not-allowed; }
.sheet-batch .bulk-submit { min-width: 124px; background: var(--ink); border-color: var(--ink); color: white; font-weight: 800; }
.sheet-batch .bulk-submit:hover:not(:disabled) { background: var(--signal); border-color: var(--signal); }
.sheet-batch .bulk-submit b { color: inherit; font: 800 11px/1 var(--mono); }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 18px 12px; }
.asset-card { position: relative; min-width: 0; }
.asset-open { display: block; width: 100%; min-width: 0; border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; }
.asset-card figure { position: relative; aspect-ratio: 4/5; margin: 0; overflow: hidden; background: #c8cac3; transition: outline-color .18s ease; }
.asset-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .45s cubic-bezier(.2,.75,.2,1), filter .3s; }
.asset-card:hover img { transform: scale(1.035); filter: contrast(1.03); }
.asset-card figure::after { content: "OPEN"; position: absolute; right: 8px; top: 8px; padding: 5px 7px; background: rgba(18,21,19,.82); color: white; opacity: 0; transform: translateY(-4px); transition: .2s; font: 8px/1 var(--mono); letter-spacing: .12em; }
.asset-card:hover figure::after { opacity: 1; transform: none; }
.asset-card figcaption { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 8px; }
.asset-card figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.asset-card figcaption b { width: 8px; height: 8px; margin-top: 2px; border: 1px solid #7e837e; border-radius: 50%; }
.asset-card[data-status="draft"] figcaption b { background: #dd9c27; border-color: #dd9c27; }
.asset-card[data-status="submitted"] figcaption b, .asset-card[data-status="confirmed"] figcaption b { background: var(--green); border-color: var(--green); }
.asset-card[data-status="rejected"] figcaption b { background: var(--signal); border-color: var(--signal); }
.asset-card.is-selected figure { outline: 3px solid var(--signal); outline-offset: -3px; }
.asset-pick { position: absolute; z-index: 3; left: 8px; top: 8px; width: 23px; height: 23px; padding: 0; border: 1px solid white; background: rgba(18,21,19,.58); color: transparent; cursor: pointer; box-shadow: 0 3px 12px rgba(0,0,0,.18); }
.asset-pick:hover { background: var(--ink); }
.asset-pick[aria-pressed="true"] { display: grid; place-items: center; background: var(--signal); border-color: var(--signal); color: white; }
.asset-pick[aria-pressed="true"]::after { content: "✓"; font: 800 12px/1 var(--mono); }
.empty-state { min-height: 340px; place-items: center; align-content: center; color: var(--muted); }
.empty-state:not([hidden]) { display: grid; }
.empty-state span { font: 500 72px/1 var(--serif); color: var(--sv-color-text-muted); }
.empty-state p { font: 9px/1 var(--mono); letter-spacing: .15em; }

.modal-open { overflow: hidden; }
.label-dialog { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; background: transparent; color: inherit; }
.label-dialog::backdrop { background: rgba(10,12,11,.84); backdrop-filter: blur(8px); }
.dialog-frame { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(390px, .6fr); width: 100%; height: 100dvh; min-height: 0; overflow: hidden; background: var(--paper-2); }
.preview-pane { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--sv-color-surface-strong); color: white; }
.preview-pane > header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 15px 22px; border-bottom: 1px solid #343835; }
.preview-pane h2 { margin: 5px 0 0; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 16px/1.2 var(--serif); }
.preview-pane nav { display: flex; }
.preview-pane nav button { width: 38px; height: 38px; border: 1px solid #424744; background: transparent; color: white; cursor: pointer; }
.preview-pane nav button + button { border-left: 0; }
.preview-pane nav button:hover { background: var(--signal); border-color: var(--signal); }
.preview-stage { --zoom-x: 50%; --zoom-y: 50%; position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; cursor: zoom-in; }
.preview-stage img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: var(--zoom-x) var(--zoom-y); transition: transform .28s ease; }
.preview-stage.is-zoomed img { transform: scale(2.25); }
.preview-stage > span { position: absolute; left: 18px; bottom: 15px; padding: 7px 9px; background: rgba(0,0,0,.58); color: var(--sv-color-text-muted); font: 8px/1 var(--mono); letter-spacing: .12em; pointer-events: none; }
.label-panel { min-width: 0; min-height: 0; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; gap: 16px; padding: 20px 26px 0; }
.label-panel > header { display: flex; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.label-panel > header span { color: var(--muted); font: 9px/1 var(--mono); }
.label-panel fieldset, .label-panel label { margin: 0; padding: 0; border: 0; font-size: 11px; font-weight: 700; }
.label-panel legend { margin-bottom: 10px; font-size: 11px; font-weight: 700; }
.role-tabs, .selection-list { display: grid; grid-template-columns: repeat(3, 1fr); }
.role-tabs button, .selection-list button { min-height: 42px; border: 1px solid #a8aca6; background: transparent; cursor: pointer; font-size: 11px; }
.role-tabs button + button, .selection-list button + button { border-left: 0; }
.role-tabs button.active { background: var(--ink); color: white; border-color: var(--ink); }
.selection-list button.active { background: #d7e3db; color: #234738; border-color: #547362; }
.label-panel select, .label-panel input, .label-panel textarea { display: block; width: 100%; margin-top: 9px; border: 1px solid #afb2ac; border-radius: 0; background: transparent; color: inherit; outline: 0; }
.label-panel select, .label-panel input { height: 40px; padding: 0 11px; }
.label-panel textarea { min-height: 92px; padding: 11px; resize: vertical; line-height: 1.55; }
.label-panel select:focus, .label-panel input:focus, .label-panel textarea:focus { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
#issueFields, #goodFields { display: grid; gap: 16px; }
.rule-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: none; overflow: visible; border: 0; }
.rule-list label { position: relative; display: grid; place-items: center; min-height: 36px; padding: 7px 8px; border: 1px solid #afb2ac; font-weight: 600; line-height: 1.25; text-align: center; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease; }
.rule-list label:hover { border-color: var(--ink); }
.rule-list label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: white; }
.rule-list label:focus-within { outline: 2px solid var(--signal); outline-offset: 1px; }
.rule-list input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.label-panel details { border-block: 1px solid var(--line); padding: 14px 0; }
.label-panel summary { cursor: pointer; font-size: 11px; font-weight: 700; }
.label-panel summary span { float: right; color: var(--muted); font: 9px/1.6 var(--mono); font-weight: 400; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.label-panel footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: auto -28px 0; padding: 16px 28px; border-top: 1px solid var(--line); background: rgba(245,243,237,.96); backdrop-filter: blur(12px); }
.label-panel footer > span { max-width: 170px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.label-panel footer > div { display: flex; gap: 8px; }
.label-panel footer button { min-height: 42px; border: 1px solid var(--ink); padding: 0 18px; cursor: pointer; font-size: 11px; font-weight: 800; }
.label-panel footer .submit { background: var(--ink); color: white; }
.label-panel footer .submit:hover { background: var(--signal); border-color: var(--signal); }
.label-panel footer .reject { background: transparent; color: var(--signal); border-color: var(--signal); }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 16px; background: var(--ink); color: white; box-shadow: 0 12px 38px rgba(0,0,0,.28); font-size: 12px; }

@media (max-width: 900px) {
  .workspace-head { grid-template-columns: auto 1fr; min-height: 86px; padding: 14px 18px; }
  .brand b { display: none; }
  .brand > span { width: 36px; height: 36px; }
  .member-chip { display: none; }
  .task-strip { grid-template-columns: 110px 1fr; padding: 14px 18px; }
  .deadline { display: none; }
  .contact-sheet { grid-template-columns: 1fr; }
  .sheet-aside { display: block; padding: 18px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .sheet-aside h2, .privacy-note, .sheet-aside > p:not(.section-number) { display: none; }
  .filters { grid-template-columns: repeat(4, 1fr); border: 0; gap: 5px; }
  .filters button { justify-content: center; gap: 5px; padding: 9px 4px; border: 1px solid #aeb1aa; font-size: 10px; }
  .filters button::before { display: none; }
  .filters button b { margin: 0; }
  .sheet-main { padding: 18px 14px 40px; }
  .sheet-toolbar { grid-template-columns: auto 1fr; }
  .sheet-toolbar label { grid-column: 1 / -1; justify-self: end; }
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 7px; }
  .dialog-frame { grid-template-columns: 1fr; grid-template-rows: 45vh 55vh; }
  .label-panel { height: 55vh; overflow-y: auto; padding: 18px 18px 0; }
  .label-panel footer { margin-inline: -18px; padding-inline: 18px; }
}
@media (max-height: 760px) and (min-width: 901px) {
  .label-panel { overflow-y: auto; }
}
@media (max-width: 560px) {
  .invite-shell { padding: 0; background: var(--paper-2); }
  .invite-card { min-height: 100vh; padding: 34px 22px; box-shadow: none; }
  .join-card { min-height: 100vh; }
  .invite-card::after { display: none; }
  .invite-mark { margin-bottom: 52px; }
  .invite-facts { grid-template-columns: 1fr 1fr; }
  .invite-facts div:first-child { grid-column: 1 / -1; }
  .invite-input-row { grid-template-columns: 1fr; gap: 8px; }
  .invite-input-row input { border-right: 1px solid var(--ink); }
  .invite-input-row button { min-height: 50px; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-toolbar label { display: none; }
  .sheet-batch { justify-self: stretch; }
  .sheet-batch button { flex: 1; padding-inline: 7px; }
  .sheet-batch .bulk-submit { min-width: 112px; }
  .pair { grid-template-columns: 1fr; }
  .rule-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
