/* components added on top of app.css, built only from its tokens and idioms */

input[type=email], input[type=password], input[type=search], input[type=tel], input[type=url] {
  width: 100%;
  min-height: 48px;
  font: 16px/1.4 var(--sans);
  color: var(--ink);
  background: var(--void);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 12px 14px;
  transition: border-color .2s var(--ease-out);
}
input[type=email]:focus, input[type=password]:focus, input[type=search]:focus, input[type=tel]:focus, input[type=url]:focus { border-color: var(--accent); outline: none; }
input:disabled, select:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }
input[aria-invalid=true], textarea[aria-invalid=true], select[aria-invalid=true] { border-color: var(--no); }
.hint { margin-top: 6px; font-size: 13px; color: var(--faint); }
.hint.no { color: var(--no); }

.kbd { display: inline-flex; align-items: center; min-height: 22px; padding: 0 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface-2); font: 500 11px/1 var(--mono); color: var(--ink); }

.switch, .radio { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--muted); cursor: pointer; }
.switch input { appearance: none; position: relative; flex: none; width: 44px; height: 24px; margin: 0; border: 1px solid var(--line-2); background: var(--void); cursor: pointer; transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--muted); transition: transform .2s var(--ease-out), background-color .2s var(--ease-out); }
.switch input:checked { border-color: var(--accent); background: var(--accent-dim); }
.switch input:checked::after { transform: translateX(20px); background: var(--accent); }
.switch input:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.radio input { appearance: none; flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin: 0; border: 1px solid var(--line-2); border-radius: 50%; background: var(--void); cursor: pointer; transition: border-color .2s var(--ease-out); }
.radio input::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .15s var(--ease-out); }
.radio input:checked { border-color: var(--accent); }
.radio input:checked::after { transform: scale(1); }
.radio input:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg > button { min-height: 40px; padding: 0 16px; border: 0; border-left: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.seg > button:first-child { border-left: 0; }
.seg > button[aria-pressed=true] { background: var(--accent); color: var(--void); }
.seg > button:focus-visible { outline: 1px solid var(--accent); outline-offset: -3px; }

.btn-group { display: inline-flex; }
.btn-group > .btn + .btn { margin-left: -1px; }
.btn-group > .btn:hover { position: relative; z-index: 1; }

.progress { height: 4px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--value, 0%); background: var(--accent); transition: width .4s var(--ease-out); }
.progress.ok > i { background: var(--ok); }
.progress.no > i { background: var(--no); }

.skeleton { display: block; height: 14px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)) 0 0 / 200% 100%; animation: shimmer 1.6s linear infinite; }
.skeleton.circle { border-radius: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 10px 14px; font: 500 10px/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table .num { text-align: right; font-family: var(--mono); }
@media (hover: hover) { .table tbody tr:hover td { background: var(--surface); } }

.accordion { border: 1px solid var(--line); }
.accordion details + details { border-top: 1px solid var(--line); }
.accordion summary, .dropdown > summary { list-style: none; cursor: pointer; }
.accordion summary::-webkit-details-marker, .dropdown > summary::-webkit-details-marker { display: none; }
.accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; font: 500 15px/1.3 var(--display); }
.accordion summary::after { content: ""; flex: none; width: 12px; height: 8px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b94a3' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .2s var(--ease-out); }
.accordion details[open] summary::after { transform: rotate(180deg); }
.accordion summary:focus-visible { outline: 1px solid var(--accent); outline-offset: -3px; }
.accordion-body { padding: 0 16px 16px; color: var(--muted); }

.dropdown { position: relative; display: inline-block; }
.dropdown-panel { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; padding: 6px; display: grid; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 24px 48px -20px #000; animation: rise .25s var(--ease-out) both; }
.dropdown-label { padding: 8px 10px 6px; font: 500 10px/1.4 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--faint); }
.dropdown-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 10px; border: 0; background: none; text-align: left; text-decoration: none; color: var(--ink); font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--accent-dim); color: var(--accent); outline: 0; }
.dropdown-item.danger { color: var(--no); }
.dropdown-item.danger:hover { background: var(--no-dim); color: var(--no); }
.dropdown-sep { height: 1px; margin: 6px 0; background: var(--line); }

.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; font: 500 11px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--faint); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current=page] { color: var(--ink); }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pager .btn[aria-current=page] { border-color: var(--accent); color: var(--accent); }
.pager .gap { font-family: var(--mono); color: var(--faint); padding: 0 4px; }

.tip { position: relative; display: inline-flex; }
.tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px); padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--line-2); font: 500 11px/1.3 var(--mono); letter-spacing: .08em; color: var(--ink); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s var(--ease-out), transform .15s var(--ease-out); z-index: 30; }
.tip:hover::after, .tip:focus-within::after { opacity: 1; transform: translate(-50%, 0); }

.field input[type="date"], .field input[type="time"], .field input[type="datetime-local"], .field input[type="number"] { width: 100%; min-height: 48px; padding: 0 14px; background: var(--void); border: 1px solid var(--line-2); color: var(--ink); font: inherit; border-radius: 0; color-scheme: dark; }
.field input[type="date"]:focus, .field input[type="time"]:focus, .field input[type="number"]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
main > section + section { margin-top: 44px; }
main > section > .eyebrow:first-child { margin-bottom: 6px; }
main > section > :is(h2, h3) { margin-bottom: 8px; }
main > section > :is(h2, h3) + p + :not(p) { margin-top: 20px; }
main > section > :is(h2, h3) + :not(p) { margin-top: 16px; }
