/* Team editor */
.editor { background: var(--bg); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.field input { height: 44px; padding: 0 12px; border: 1.5px solid var(--line); background: var(--white); border-radius: 0; outline: none; }
.field input:focus { border-color: var(--navy); }

/* Gate */
.gate { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 40px 16px; }
.gate__card { position: relative; width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 32px; background: var(--white); border: 1.5px solid var(--line); }
.gate__card::after { content: ""; position: absolute; right: -1.5px; bottom: -1.5px; width: 20px; height: 20px; background: var(--bg); clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.gate h1 { margin: 0; font: 500 36px/1 var(--display); letter-spacing: -.03em; color: var(--red); }
.gate__lede { margin: -4px 0 4px; color: var(--ink-2); }
.gate__error { margin: 0; color: var(--red); font-weight: 600; }

/* Save bar */
.savebar { position: sticky; top: 0; z-index: 40; background: var(--ink); color: var(--white); }
.savebar__in { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.savebar__state { display: flex; align-items: center; gap: 12px; }
.savebar__state strong { display: block; font-weight: 600; }
.savebar__state small { display: block; color: rgba(255, 255, 255, .6); font-size: 12px; }
.dot { width: 10px; height: 10px; background: #5fbf7f; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.dot.is-dirty { background: #ffc94d; }
.savebar__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.savebar .btn--ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .3); }
.savebar .btn--ghost:hover { border-color: var(--white); color: var(--white); }
.savebar .btn:disabled { opacity: .4; cursor: default; }
.note { height: 44px; width: 260px; padding: 0 12px; border: 1.5px solid rgba(255, 255, 255, .3); background: transparent; color: var(--white); border-radius: 0; outline: none; }
.note::placeholder { color: rgba(255, 255, 255, .5); }

/* Checks */
.checks { margin: 24px 0 16px; }
.checks__box { padding: 16px 20px; background: #FFF8E5; border: 1.5px solid #F2DFA6; }
.checks__box ul { margin: 10px 0 0; padding-left: 18px; columns: 2 380px; column-gap: 32px; }
.checks__box li { margin: 0 0 4px; break-inside: avoid; font-size: 14px; }
.checks__box--ok { background: var(--ok-bg); border-color: #bfe0c8; color: var(--ok-ink); }

/* Settings */
.settings { margin: 0 0 24px; background: var(--white); border: 1.5px solid var(--line); }
.settings summary { display: flex; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; list-style: none; }
.settings summary::-webkit-details-marker { display: none; }
.settings__hint { color: var(--ink-2); font-size: 14px; }
.settings__body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.settings__row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; width: 100%; max-width: 720px; }
.docrow { display: grid; grid-template-columns: 220px 1fr auto auto; gap: 8px; align-items: center; width: 100%; }
.docrow input:not([type=checkbox]) { height: 38px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 0; outline: none; min-width: 0; }
.docrow input:focus { border-color: var(--navy); }
.mini { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; }

/* Sections and sheet */
.sec { margin: 0 0 28px; }
.sec__head { display: flex; align-items: center; gap: 12px; padding: 0 0 0 14px; background: var(--ink); color: var(--white); }
.sec__name { flex: 0 1 320px; height: 46px; background: transparent; border: 0; color: var(--white); font: 500 17px/1 var(--display); outline: none; }
.sec__name:focus { background: rgba(255, 255, 255, .08); }
.sec__count { font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.sec__tools { margin-left: auto; display: flex; }
.sec__tools .icon { color: var(--white); width: 46px; height: 46px; }
.sec__tools .icon:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }

.sheet-wrap { overflow-x: auto; background: var(--white); border: 1.5px solid var(--line); border-top: 0; }
.sheet { border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.sheet th { height: 34px; padding: 0 8px; background: var(--red); color: var(--white); font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-align: left; white-space: nowrap; position: sticky; top: 0; }
.sheet td { height: 38px; padding: 0; border: 1px solid var(--line); white-space: nowrap; }
.sheet input, .sheet select { width: 100%; height: 37px; padding: 0 8px; border: 0; background: transparent; border-radius: 0; outline: none; }
.sheet input:focus, .sheet select:focus { background: #EEF3F9; box-shadow: inset 0 0 0 2px var(--navy); }
.sheet input.num { text-align: right; }
.sheet .calc { padding: 0 8px; text-align: right; background: var(--grey); color: var(--ink-2); font-weight: 600; }
.sheet .rownum { width: 40px; text-align: center; color: var(--muted); font: 400 11px/1 var(--mono); background: var(--zebra); }
.sheet th.rownum { background: var(--red-dark); color: var(--white); }
.sheet tr.has-issue .rownum { background: #FFF1CC; cursor: help; }
.warn { display: inline-grid; place-items: center; width: 18px; height: 18px; background: #E8A400; color: var(--white); font-weight: 700; font-family: var(--font); }
.sheet select.st { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.sheet select.status--available { background: var(--ok-bg); color: var(--ok-ink); }
.sheet select.status--hold { background: var(--hold-bg); color: var(--hold-ink); }
.sheet select.status--sold { background: var(--sold-bg); color: var(--sold-ink); }
.urlcell { position: relative; }
.urlcell input { padding-right: 28px; font-size: 12px; color: var(--navy); }
.urlcell a { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); text-decoration: none; color: var(--navy); font-weight: 700; }
.rowtools { padding: 0 4px !important; background: var(--zebra); }
.icon { width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.icon:hover:not(:disabled) { color: var(--navy); background: var(--grey); }
.icon--del:hover:not(:disabled) { color: var(--red); }
.icon:disabled { opacity: .3; cursor: default; }
.addrow { width: 100%; height: 42px; border: 1.5px dashed var(--line); border-top: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 500; text-align: left; padding: 0 14px; }
.addrow:hover { color: var(--navy); border-color: var(--navy); background: #F5F8FC; }
#addSection { margin-bottom: 60px; }

/* History drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(440px, 100%); background: var(--white); border-left: 1.5px solid var(--line); box-shadow: -20px 0 40px -20px rgba(0, 0, 0, .25); padding: 24px; overflow-y: auto; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; }
.drawer h2 { margin: 0; font: 500 28px/1 var(--display); color: var(--red); letter-spacing: -.02em; }
.drawer__lede { color: var(--ink-2); font-size: 14px; }
.versions { list-style: none; margin: 0; padding: 0; }
.versions li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.versions strong { display: block; }
.versions span { font-size: 13px; color: var(--ink-2); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; padding: 14px 20px; background: var(--ok-ink); color: var(--white); font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); max-width: calc(100% - 32px); }
.toast--bad { background: var(--red); }

@media (max-width: 760px) {
  .note { width: 100%; }
  .savebar__actions { width: 100%; }
  .settings__row { grid-template-columns: 1fr; }
  .docrow { grid-template-columns: 1fr; }
}
