/* Mitosis Safe. Colours and type come from brand.css: words in
   Schibsted Grotesk; figures, hashes and addresses in IBM Plex Mono; colour only for
   state. Every page opens with one large figure and one chart drawn from chain data;
   below that, rows ruled by 1px lines, no cards. */
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400 700; font-display: swap; src: url(/static/schibsted.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 300; font-display: swap; src: url(/static/plex-300.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/static/plex-400.woff2) format("woff2"); }

body { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
main { flex: 1; padding-top: 40px; padding-bottom: 72px; display: grid; gap: 40px; align-content: start; }
main > * { min-width: 0; }
h1 { margin: 0; font-size: var(--text-2xl); font-weight: 500; line-height: 1.2; }
h2 { margin: 0; font-size: var(--text-l); font-weight: 500; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
section { display: grid; gap: 14px; align-content: start; min-width: 0; }

.mono, .addr, .lead, .big { font-family: var(--figure); font-variant-numeric: tabular-nums; }
.label, .kicker { color: var(--mute); font-size: var(--text-s); }
h1.kicker { font-weight: 400; line-height: 1.6; }
.mute { color: var(--mute); }
.fg { color: var(--fg); }
.small { font-size: var(--text-s); }
.block { display: block; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); overflow-wrap: anywhere; }
.lead { margin: 0; font-weight: 300; font-size: clamp(var(--text-xl), 6vw, var(--text-2xl)); line-height: 1.1; overflow-wrap: anywhere; }
.wrap-any { overflow-wrap: anywhere; word-break: break-all; }
[hidden] { display: none !important; }

/* The lead figure: Plex 300 at 48px, its unit in words beside it. */
.big { margin: 0; font-size: clamp(var(--text-2xl), 7vw, var(--text-3xl)); font-weight: 300; line-height: 1.05; letter-spacing: -.02em; overflow-wrap: anywhere; }
.big small { margin-left: .35em; font: 400 var(--text-l) var(--voice); letter-spacing: 0; color: var(--mute); }
.lede { font-size: var(--text-l); line-height: 1.5; color: var(--mute); }
.lede b { color: var(--fg); font-weight: 400; }
.top { display: grid; gap: 8px; align-content: end; }

/* Header and footer */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { height: 24px; width: auto; }
.brand span { color: var(--mute); }
.brand:hover span { color: var(--fg); }
.bar-right { display: flex; align-items: center; gap: 20px; min-width: 0; }
.net { display: flex; align-items: center; gap: 7px; font: var(--text-s) var(--figure); font-variant-numeric: tabular-nums; color: var(--mute); white-space: nowrap; text-decoration: none; }
.net:hover { color: var(--fg); }
.net::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.net.live::before { background: var(--ok); }
.foot { padding-top: 20px; padding-bottom: 22px; font-size: var(--text-s); color: var(--mute); }

/* A week per bar, drawn on the server. */
figure.strip { margin: 0; display: grid; gap: 8px; min-width: 0; align-content: end; }
figure.strip svg { display: block; width: 100%; height: 56px; background: var(--cell); border-radius: var(--radius-cell); }
figure.strip path { fill: var(--fg); }
figure.strip figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; font-size: var(--text-s); color: var(--mute); }

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 16px; justify-self: start;
  border: 1px solid var(--line); border-radius: var(--radius-control);
  background: transparent; color: var(--fg); font: 500 var(--text-m)/1.5 var(--voice);
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--mute); }
.btn.mono { font-family: var(--figure); font-weight: 400; font-size: var(--text-s); padding-block: 8px; }
.btn.primary { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn.primary:hover { background: var(--mute); border-color: var(--mute); }
.btn[aria-current="page"] { border-color: var(--fg); }
.btn:disabled, .btn:disabled:hover { background: transparent; border-color: var(--line); color: var(--mute); cursor: wait; }
.act {
  background: none; border: 0; padding: 0; color: var(--mute); font: inherit; font-size: var(--text-s); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px;
}
.act:hover { color: var(--fg); text-decoration-color: var(--fg); }
.input {
  width: 100%; min-width: 0; padding: 9px 12px; background: var(--cell); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius-cell); font: 400 var(--text-m)/1.5 var(--voice);
}
.input:focus { outline: none; border-color: var(--mute); }
.input::placeholder { color: var(--mute); }
.input.mono { font-family: var(--figure); font-size: var(--text-s); line-height: 1.7; }
textarea.input { resize: vertical; }
select.input {
  appearance: none; padding-right: 30px;
  background: var(--cell) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238f8b81' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.field { display: grid; gap: 6px; }
.field.narrow { max-width: 15rem; }
.stack { display: grid; gap: 18px; max-width: 40rem; }
.inline { display: flex; gap: 8px; align-items: end; }
.inline .field { flex: 1; }
.acts, .actions, .pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.actions { gap: 12px; padding-top: 4px; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }

/* Opening a Safe by address: the page's one big input, as on scan. */
.search { display: flex; gap: 8px; max-width: 40rem; }
.search .input { padding: 13px 16px; font-size: var(--text-m); }
.search .btn { padding-inline: 22px; }

/* Segmented modes: one control, the current mode on --cell. */
nav.modes { display: inline-flex; flex-wrap: wrap; justify-self: start; border: 1px solid var(--line); border-radius: var(--radius-control); }
nav.modes .btn { border: 0; border-radius: 0; color: var(--mute); }
nav.modes .btn + .btn { border-left: 1px solid var(--line); }
nav.modes .btn:hover { color: var(--fg); }
nav.modes .btn[aria-current="page"] { background: var(--cell); color: var(--fg); }

/* Rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-top: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 1px solid var(--line); }
.row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; padding: 12px 0; }
.row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .sub { flex-basis: 100%; }
.row .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A row that opens something lights up across the column on hover. */
a.row, summary.row { margin-inline: -10px; padding-inline: 10px; color: var(--fg); text-decoration: none; }
a.row:hover, summary.row:hover { background: var(--cell); }
.item .meta { display: inline-flex; gap: 16px; margin-left: auto; font-size: var(--text-s); color: var(--mute); white-space: nowrap; }
.item .meta .t { min-width: 3.2em; text-align: right; }
.empty { color: var(--mute); font-size: var(--text-s); border-block: 1px solid var(--line); padding: 24px 0; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.detail { display: grid; gap: 20px; padding: 8px 0 28px; }
.group { gap: 6px; }
.day { gap: 6px; }
.day + .day { margin-top: 20px; }

/* Signatures against the threshold: a segment per signature needed. */
.sigs { display: inline-flex; align-items: center; gap: 10px; color: var(--mute); white-space: nowrap; }
.sigs.ok { color: var(--ok); }
.meter { display: inline-flex; gap: 3px; }
.meter i { width: 18px; height: 6px; background: var(--line); }
.meter i.on { background: var(--fg); }
.sigs.ok .meter i.on { background: var(--ok); }
.sigline { display: flex; align-items: center; gap: 12px; }

/* Label and value pairs, ruled like rows. */
.kv { display: grid; grid-template-columns: 10rem minmax(0, 1fr); margin: 0; }
.kv > dt, .kv > dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); }
.kv > dt { color: var(--mute); font-size: var(--text-s); line-height: 1.9; padding-right: 16px; overflow-wrap: anywhere; }
.kv > dd { min-width: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.kv > dd.data { display: grid; gap: 8px; }
.kv code { display: block; margin-top: 4px; }
pre.words, pre.message {
  margin: 0; padding: 12px 14px; background: var(--cell); border-radius: var(--radius-cell);
  font-size: var(--text-s); line-height: 1.7; color: var(--mute); overflow: auto; max-height: 22rem;
}
pre.words { white-space: pre; }
pre.words::first-line { color: var(--fg); }
pre.message { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
details summary.act { display: inline; }
details[open] > summary.act { display: block; margin-bottom: 8px; }

/* Home */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px 56px; align-items: end; }

/* A Safe's pages: who it is and what it holds, then its activity. */
.safe-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; }
.who { display: grid; gap: 8px; min-width: 0; }
.who .big { margin-top: 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: var(--text-s); color: var(--mute); }
.facts a { color: inherit; text-decoration: underline 1px var(--line); text-underline-offset: 3px; }
.facts a:hover { color: var(--fg); text-decoration-color: var(--fg); }
.addr-line { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; max-width: 100%; }
.addr-line .tools { display: inline-flex; gap: 12px; white-space: nowrap; }
.split .addr { font-size: var(--text-s); }
.addr { overflow-wrap: anywhere; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 26px; border-bottom: 1px solid var(--line); margin-bottom: -12px; }
.tabs a { padding: 12px 0; color: var(--mute); text-decoration: none; border-bottom: 1px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }
.tabs .n { margin-left: 6px; font-size: var(--text-s); color: var(--warn); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 48px; align-items: start; }
.notice { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 14px 0; border-block: 1px solid var(--line); color: var(--warn); text-decoration: none; }
.notice .fg { color: var(--warn); }
.notice .go { color: var(--mute); text-decoration: underline 1px var(--line); text-underline-offset: 3px; }
.notice:hover .go { color: var(--fg); text-decoration-color: var(--fg); }
main a.mono { text-decoration-color: var(--line); }
main a.mono:hover { text-decoration-color: var(--fg); }
.review { gap: 20px; max-width: 52rem; }
.review h2 { overflow-wrap: anywhere; }
h2.title { font-size: var(--text-xl); line-height: 1.3; display: block; }
p.state { display: flex; align-items: center; gap: 8px; }
p.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* Wallet dialog */
dialog { width: min(28rem, calc(100vw - 32px)); padding: 24px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius-cell); }
dialog::backdrop { background: rgb(0 0 0 / 0.6); }
dialog > * + * { margin-top: 16px; }
.dialog-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.dialog-head h2 { margin: 0; }
#wallet-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; background: none; border: 0; color: var(--fg); font: inherit; cursor: pointer; text-align: left; }
#wallet-list button:hover { color: var(--mute); }
#wallet-list img { width: 28px; height: 28px; }
.qr { background: var(--fg); padding: 12px; border-radius: var(--radius-cell); line-height: 0; }
.qr svg { width: 100%; height: auto; }

@media (max-width: 860px) {
  .hero, .safe-head, .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  main { padding-top: 28px; gap: 32px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv > dt { padding-bottom: 0; }
  .kv > dd { border-top: 0; padding-top: 2px; }
  .addr { font-size: var(--text-s); }
  .inline { flex-wrap: wrap; }
  .search .btn { padding-inline: 16px; }
  .bar-right { gap: 12px; }
}
/* On a phone the tabs stay on one line that swipes sideways. */
@media (max-width: 640px) and (pointer: coarse) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: -12px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { margin-bottom: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .act, .tabs a, .input, a.row, summary.row, .net, .notice .go { transition: color .15s, background-color .15s, border-color .15s, text-decoration-color .15s; }
}
.tabs + .empty { border-top: 0; padding-top: 4px; }
