/* COITick app screens */
.appbar { background: var(--ink); color: var(--paper); position: sticky; top: 0; z-index: 5; }
.appbar-in { max-width: 72rem; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.appbar .brand { color: var(--paper); }
.tabs { display: flex; gap: .15rem; margin-left: auto; }
.tabs button {
  background: none; border: 0; color: inherit; font: inherit; font-weight: 600; cursor: pointer;
  padding: .55rem .8rem; border-radius: var(--r-sm); opacity: .78; min-height: 2.6rem;
}
.tabs button:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.tabs button[aria-current="page"] { opacity: 1; box-shadow: inset 0 -3px 0 var(--hivis); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .appbar { background: #0E1314; color: var(--ink); } :root:not([data-theme="light"]) .appbar .brand { color: var(--ink); } }

.banner { background: var(--warn-bg); color: var(--warn); font-weight: 600; padding: .7rem 1rem; text-align: center; }

.shell { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem 5rem; }
@media (min-width: 48rem) { .shell { padding: 2rem 2rem 5rem; } }

.head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.head h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 850; letter-spacing: -.02em; line-height: 1.05; font-variation-settings: "wdth" 112; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
label.btn { font-size: 1rem; }

/* Status summary: three tag-shaped filter buttons */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.sum {
  --c: var(--ok); --bg: var(--ok-bg);
  position: relative; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--surface); border: 0; border-left: .5rem solid var(--c);
  border-radius: 0 var(--r-md) var(--r-md) 0; padding: .8rem 1rem .85rem 1.1rem; box-shadow: var(--shadow);
  display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; min-height: 4.2rem;
}
.sum b { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 850; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 115; }
.sum span { color: var(--ink-2); font-weight: 600; }
.sum.yellow { --c: var(--warn); --bg: var(--warn-bg); border-left-color: #E0B400; }
.sum.red { --c: var(--bad); --bg: var(--bad-bg); }
.sum:hover { background: var(--bg); }
.sum[aria-pressed="true"] { background: var(--bg); outline: 2px solid var(--c); outline-offset: -2px; }
@media (max-width: 30rem) { .sum { flex-direction: column; gap: .15rem; padding: .7rem .7rem .7rem .8rem; } .sum span { font-size: .85rem; } }

.filterbar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filterbar input { max-width: 26rem; }

/* Sub rows */
.list { display: grid; gap: .5rem; }
.row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem 1rem;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); padding-right: 1rem;
}
.row-open {
  display: grid; grid-template-columns: 9.5rem 1fr; grid-template-areas: "tag name" "tag issue" "tag meta";
  align-items: center; column-gap: 1rem; text-align: left; background: none; border: 0; color: inherit; font: inherit;
  padding: .85rem 0 .85rem 1rem; cursor: pointer; border-radius: var(--r-md); min-width: 0;
}
.row-open .tag { grid-area: tag; justify-self: start; }
.row-name { grid-area: name; font-weight: 750; font-size: 1.05rem; overflow-wrap: anywhere; }
.row-trade { color: var(--ink-2); font-weight: 500; font-size: .92rem; margin-left: .35rem; }
.row-issue { grid-area: issue; color: var(--ink); }
.row.green .row-issue { color: var(--ink-2); }
.row-issue .more { color: var(--ink-2); font-size: .9rem; }
.row-meta { grid-area: meta; color: var(--ink-2); font-size: .85rem; }
.row-open:hover .row-name { text-decoration: underline; text-underline-offset: .18em; }
@media (max-width: 40rem) {
  .row { grid-template-columns: 1fr; padding: 0 0 .85rem; }
  .row-open { grid-template-columns: 1fr; grid-template-areas: "tag" "name" "issue" "meta"; row-gap: .25rem; padding: .85rem 1rem 0; }
  .row-chase { justify-self: start; margin-left: 1rem; }
}

.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; font-weight: 600; }

.empty { background: var(--surface); border: 2px dashed var(--rule); border-radius: var(--r-md); padding: 2.5rem 1.5rem; text-align: center; }
.empty h2 { margin: 0 0 .5rem; font-size: 1.4rem; font-weight: 800; }
.empty p { margin: 0 auto .6rem; max-width: 34rem; }
#view-subs.dropping .list, #view-subs.dropping .empty { outline: 3px dashed var(--focus); outline-offset: 6px; border-radius: var(--r-md); }

/* Panels and forms */
.panel { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 1.25rem; }
@media (min-width: 48rem) { .panel { padding: 1.75rem 2rem; } }
fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
legend { font-weight: 800; font-size: 1.1rem; padding: 0; margin-bottom: .35rem; }
fieldset > .hint { margin: 0 0 .9rem; }
.grid2, .grid3 { display: grid; gap: .9rem; }
@media (min-width: 40rem) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.narrow { max-width: 22rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 650; font-size: 1rem; cursor: pointer; min-height: 2.6rem; }

.reqrows { display: grid; gap: 0; }
.reqrow { display: grid; gap: .6rem 1rem; padding: .9rem 0; border-top: 1.5px solid var(--rule); align-items: end; }
@media (min-width: 48rem) { .reqrow { grid-template-columns: 16rem 1fr 1fr; } .reqrow .check { align-self: center; } }
.reqrow input:disabled { opacity: .45; }
.lead { margin: 0 0 1.5rem; max-width: 44rem; font-size: 1.05rem; }
.bk-list { display: grid; }
.bk { display: grid; gap: .9rem; padding: 1.25rem 0; border-top: 1.5px solid var(--rule); align-items: center; }
@media (min-width: 48rem) { .bk { grid-template-columns: 1fr auto; } }
.bk h2 { margin: 0 0 .2rem; font-size: 1.1rem; font-weight: 800; }
.bk .hint { margin: 0; max-width: 38rem; }
.bk-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Dialogs */
dialog {
  border: 0; padding: 0; color: var(--ink); background: var(--paper);
  width: min(46rem, 100vw); max-width: 100vw; max-height: 100dvh; height: 100dvh;
  margin: 0 0 0 auto; box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .45);
}
dialog[open] { display: flex; animation: slidein .22s cubic-bezier(.2, .8, .3, 1); }
dialog::backdrop { background: rgba(20, 27, 30, .45); }
dialog > form { display: flex; flex-direction: column; width: 100%; min-height: 0; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.small { width: min(28rem, calc(100vw - 2rem)); height: auto; margin: auto; border-radius: var(--r-md); box-shadow: var(--shadow); }
dialog.small[open] { animation: none; }
dialog.small h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
dialog.small p { margin: 0; color: var(--ink-2); }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem .9rem; border-bottom: 1.5px solid var(--rule); background: var(--surface); }
.dlg-head h2 { margin: 0 0 .35rem; font-size: 1.4rem; font-weight: 850; line-height: 1.15; font-variation-settings: "wdth" 108; overflow-wrap: anywhere; }
.dlg-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.dlg-foot { display: flex; gap: .6rem; padding: .9rem 1.25rem; border-top: 1.5px solid var(--rule); background: var(--surface); flex-wrap: wrap; }
.dlg-foot .spacer { flex: 1; }
.close { min-height: 2.6rem; }
@media (max-width: 30rem) { .dlg-foot .btn { flex: 1 1 auto; } .dlg-foot .spacer { display: none; } }

.notice { background: var(--warn-bg); color: var(--ink); border-radius: var(--r-sm); padding: .8rem 1rem; margin-bottom: 1.25rem; border-left: 4px solid #E0B400; }
.issues { margin-bottom: 1.5rem; }
.issues ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.issues li { padding-left: 1.2rem; position: relative; font-weight: 600; }
.issues li::before { content: ""; position: absolute; left: 0; top: .5em; width: .55rem; height: .55rem; border-radius: 50%; }
.issues li.red { color: var(--bad); } .issues li.red::before { background: var(--bad); }
.issues li.yellow { color: var(--warn); } .issues li.yellow::before { background: #E0B400; }
.ok-line { margin: 0; color: var(--ok); font-weight: 650; }

.cov { display: grid; }
.cov-row { display: grid; gap: .6rem .8rem; padding: .85rem 0; border-top: 1.5px solid var(--rule); }
.cov-row:first-child { border-top: 0; padding-top: .25rem; }
.cov-name { font-weight: 750; display: flex; flex-direction: column; }
.cov-name .hint { font-weight: 400; }
@media (min-width: 40rem) { .cov-row { grid-template-columns: 10rem repeat(3, 1fr); align-items: end; } .cov-name { align-self: center; } }
.check.ai { margin-top: .5rem; }
.cert { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.cert > span { margin-right: auto; overflow-wrap: anywhere; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .92rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--paper); padding: .75rem 1.1rem; border-radius: var(--r-sm);
  font-weight: 600; box-shadow: var(--shadow); max-width: calc(100vw - 2rem);
}
