/* Subtwine styles — the shell around every page (R6): the app bar with the
   account area, the account popover, the standing folder notice, the
   unsupported-browser page and the drop overlay.
   Loaded from index.html in the order web_manifest.py declares. */

/* ---- the app bar ---- */
.appbar {
  position:sticky;
  top:0;
  z-index:40;
  height:var(--appbar-h);
  display:flex;
  align-items:center;
  gap:14px;
  padding:0 20px;
  background:color-mix(in srgb,var(--bg) 90%,transparent);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line-soft);
  min-width:0;
}
.brand {
  display:flex;
  align-items:center;
  gap:9px;
  font-weight:650;
  font-size:16.5px;
  letter-spacing:-.01em;
  flex:none;
  border-radius:8px;
}
.appbar-right {
  margin-inline-start:auto;
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.account-area {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.quota-chip {
  display:inline-flex;
  align-items:center;
  gap:7px;
  height:34px;
  padding:0 11px 0 7px;
  border:1px solid var(--line);
  border-radius:99px;
  background:var(--surface);
  font-size:13px;
  white-space:nowrap;
}
.quota-chip:hover {
  background:var(--hover);
}
.quota-chip .ring {
  width:22px;
  height:22px;
  transform:rotate(-90deg);
}
.ring-bg {
  fill:none;
  stroke:var(--surface-2);
  stroke-width:4.5;
}
.ring-fg {
  fill:none;
  stroke:var(--accent);
  stroke-width:4.5;
  stroke-linecap:round;
  transition:stroke-dashoffset .3s;
}
.quota-chip[data-level=warn] .ring-fg {
  stroke:var(--busy);
}
.quota-chip[data-level=low] .ring-fg,
.quota-chip[data-level=empty] .ring-fg {
  stroke:var(--fail);
}
.quota-chip[data-level=low],
.quota-chip[data-level=empty] {
  border-color:color-mix(in srgb,var(--fail) 40%,var(--line));
}
.account-chip-minutes {
  font-variant-numeric:tabular-nums;
}
.account-button {
  display:inline-flex;
  align-items:center;
  gap:8px;
  height:34px;
  padding:0 12px;
  border-radius:99px;
  border:1px solid var(--line);
  background:var(--surface);
  font-size:13px;
  font-weight:550;
  min-width:0;
  max-width:240px;
}
.account-button.signed-in {
  border-color:transparent;
  background:none;
  padding:0 8px 0 4px;
  font-weight:400;
  color:var(--ink-2);
}
.account-button:hover {
  background:var(--hover);
}
.account-chip-label {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}
.account-button .i {
  color:var(--muted);
}
.avatar {
  width:26px;
  height:26px;
  border-radius:50%;
  display:inline-grid;
  place-items:center;
  background:var(--accent-soft);
  color:var(--accent-ink);
  font-weight:650;
  font-size:12px;
  flex:none;
}
.avatar.lg {
  width:38px;
  height:38px;
  font-size:15px;
}

/* ---- the account popover ---- */
.account-popover {
  top:calc(var(--appbar-h) - 4px);
  inset-inline-end:16px;
  width:340px;
  max-width:calc(100vw - 32px);
  padding:16px;
  max-height:calc(100vh - var(--appbar-h) - 16px);
  overflow:auto;
}
.ap-head {
  display:flex;
  gap:12px;
  align-items:center;
}
.ap-who {
  display:grid;
  min-width:0;
}
.ap-label {
  font-size:11.5px;
  color:var(--muted);
}
.ap-who b {
  font-size:14px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.ap-minutes {
  margin:14px 0 12px;
  padding:14px;
  border-radius:10px;
  background:var(--sidebar);
  border:1px solid var(--line-soft);
}
.ap-total {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  font-size:13px;
  color:var(--muted);
}
.ap-total b {
  font-size:22px;
  color:var(--ink);
  font-variant-numeric:tabular-nums;
  letter-spacing:-.02em;
}
.meter {
  height:6px;
  border-radius:99px;
  background:var(--surface-2);
  overflow:hidden;
  margin:8px 0 10px;
}
.meter i {
  display:block;
  height:100%;
  width:0;
  border-radius:99px;
  background:var(--accent);
  transition:width .3s;
}
.meter[data-level=warn] i {
  background:var(--busy);
}
.meter[data-level=low] i,
.meter[data-level=empty] i {
  background:var(--fail);
}
.ap-buckets {
  margin:0;
  display:grid;
  gap:6px;
}
.ap-buckets div {
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:13px;
}
.ap-buckets dt {
  color:var(--ink-2);
}
.ap-buckets dt small {
  display:block;
  color:var(--faint);
  font-size:11.5px;
}
.ap-buckets dd {
  margin:0;
  font-variant-numeric:tabular-nums;
  font-weight:550;
  text-align:end;
  white-space:nowrap;
}
.ap-order {
  margin:10px 0 0;
  font-size:12px;
  font-weight:600;
  color:var(--ink-2);
}
.ap-rule {
  margin:6px 0 0;
  font-size:11.5px;
  color:var(--muted);
  line-height:1.5;
}
.ap-links {
  display:grid;
  border-top:1px solid var(--line-soft);
  padding-top:6px;
}
.ap-links button {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:36px;
  padding:0 8px;
  border-radius:8px;
  font-size:13.5px;
  color:var(--ink-2);
  text-align:start;
}
.ap-links button:hover {
  background:var(--hover);
  color:var(--ink);
}
.ap-note {
  margin:6px 8px 0;
  font-size:11.5px;
  color:var(--faint);
}

/* ---- the folder notice ---- */
.page-notice {
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin:12px 20px 0;
  padding:10px 14px;
  border-radius:10px;
  background:var(--accent-soft);
  color:var(--accent-ink);
  font-size:13px;
}
.page-notice.warn {
  background:var(--diff-bg);
  color:var(--diff);
  margin:6px 0 0;
}

/* ---- the unsupported browser ---- */
body[data-gate="unsupported"] > :not(#browser-gate) {
  display:none!important;
}
.browser-gate {
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px 16px;
}
.browser-gate-card {
  width:min(520px,100%);
  padding:32px 28px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface);
  box-shadow:var(--shadow-dialog);
  display:grid;
  gap:6px;
  justify-items:start;
}
.browser-gate-card h1 {
  font-size:21px;
  margin-top:10px;
}
.browser-gate-card p {
  margin:0;
  color:var(--ink-2);
}
.browser-gate-site {
  color:var(--accent);
  font-weight:600;
}
.browser-gate-missing code {
  font-size:12px;
  color:var(--muted);
  overflow-wrap:anywhere;
}

/* ---- dropping a file anywhere on the page ---- */
.drag-overlay {
  position:fixed;
  inset:0;
  z-index:80;
  background:color-mix(in srgb,var(--accent) 16%,var(--scrim));
  display:grid;
  place-items:center;
  pointer-events:none;
}
.drag-overlay>div {
  display:grid;
  justify-items:center;
  gap:10px;
  padding:32px 48px;
  border-radius:18px;
  background:var(--surface);
  border:2px dashed var(--accent);
  color:var(--accent-ink);
  font-size:16px;
  max-width:calc(100vw - 32px);
  text-align:center;
}

main {
  min-width:0;
}
.view {
  min-width:0;
}

@media (max-width:640px) {
  .appbar {
    padding:0 12px;
    gap:8px;
  }
  .brand-name {
    display:none;
  }
  .account-button {
    max-width:150px;
  }
  .account-button.signed-in .account-chip-label,
  #account-chevron {
    display:none;
  }
  .page-notice {
    margin:10px 16px 0;
  }
}
@media (max-width:400px) {
  #account-start {
    display:none;
  }
}
