/* The workspace's own pages beyond the tools, and the pieces every page
   shares: the designed confirmation, a failed read, a page heading with its
   actions, Notifications, Usage, and the not found and not allowed states.
   Surfaces are steps of background, never outlines, shadows or rings. */

/* ------------------------------------------------------------ the dialog */

.pf-confirm {
  width: min(440px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; margin: auto;
  border: 0; border-radius: 16px; background: #15171d; color: #eef0f7;
  font-family: var(--font-sans, 'Geist', Arial, sans-serif); overflow: auto;
}
.pf-confirm::backdrop { background: rgba(4, 5, 8, .72); }
.pf-confirm-card { display: flex; flex-direction: column; gap: 0; padding: 24px; }
.pf-confirm h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; text-wrap: balance; }
.pf-confirm p { margin: 10px 0 0; color: rgba(255, 255, 255, .64); font-size: 13.5px; line-height: 1.55; text-wrap: pretty; }
.pf-confirm-detail:not(:empty) { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.pf-confirm-type, .pf-confirm-field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.pf-confirm-detail .pf-confirm-field { margin-top: 0; }
.pf-confirm-type b { color: #fff; font-weight: 620; }
.pf-confirm input, .pf-confirm select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid transparent;
  background: #1d2029; color: #fff; font: inherit; font-size: 14px;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.pf-confirm select { appearance: none; padding-right: 36px; cursor: pointer; }
.pf-confirm .st-select { position: relative; display: block; }
.pf-confirm .pf-dd { display: flex; width: 100%; }
.pf-confirm .pf-dd-btn { height: 42px; background: #1d2029; font-size: 14px; }
.pf-confirm .st-select:has(.pf-dd)::after { display: none; }
.pf-confirm .st-select::after {
  content: ''; position: absolute; right: 15px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.7px solid rgba(255, 255, 255, .6); border-bottom: 1.7px solid rgba(255, 255, 255, .6); transform: rotate(45deg); pointer-events: none;
}
.pf-confirm input:focus, .pf-confirm select:focus { outline: none; border-color: rgba(141, 162, 255, .55); background: #20232d; }
.pf-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.pf-confirm-actions .pf-btn { min-width: 96px; justify-content: center; white-space: nowrap; }
.pf-confirm-actions .pf-btn:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 420px) {
  .pf-confirm-card { padding: 20px 16px 16px; }
  .pf-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pf-confirm-actions .pf-btn { min-width: 0; }
  .pf-confirm-actions .pf-btn:only-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------------- a failed read */

html.ui-v2 .pf-error-state { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: 14px; background: var(--pf-panel); flex-wrap: wrap; }
html.ui-v2 .pf-error-state p { margin: 0; font-size: 13.5px; color: var(--pf-dim); line-height: 1.5; text-wrap: pretty; flex: 1 1 240px; }
html.ui-v2 .pf-error-state .pf-btn { flex: 0 0 auto; white-space: nowrap; }
html.ui-v2 .pf-page-note { margin: 0 0 12px; font-size: 13px; color: var(--pf-bad); }

/* ----------------------------------------------------- a page's heading */

html.ui-v2 .pf-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
html.ui-v2 .pf-page-head .pf-h1 { margin: 0; }
html.ui-v2 .pf-page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html.ui-v2 .pf-page-actions .pf-btn { white-space: nowrap; }
html.ui-v2 .pf-page-quiet { margin: 0; color: var(--pf-dim); font-size: 13.5px; }
html.ui-v2 .pf-page-empty { display: flex; align-items: center; gap: 12px; padding: 22px; border-radius: 16px; background: var(--pf-panel); color: var(--pf-dim); }
html.ui-v2 .pf-page-empty p { margin: 0; font-size: 14px; }

/* ------------------------------------------------------- notifications */

html.ui-v2 .pf-notes-page { max-width: 820px; padding-bottom: 40px; }
html.ui-v2 .pf-notes-body { display: flex; flex-direction: column; gap: 28px; }
html.ui-v2 .pf-notes-block h2 { margin: 0 0 10px; font-size: 15px; font-weight: 640; letter-spacing: -.01em; }
html.ui-v2 .pf-notes-rows { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 16px; background: var(--pf-panel); }
html.ui-v2 .pf-notes-rows .pf-note { padding: 12px; }
html.ui-v2 .pf-notes-rows .pf-note:hover, html.ui-v2 .pf-notes-rows .pf-note:focus-visible { background: #171920; }
html.ui-v2 .pf-notes-rows .pf-note-copy b { white-space: normal; font-size: 13.5px; text-wrap: pretty; }
html.ui-v2 .pf-notes-rows .pf-note-copy span { font-size: 12.5px; }
/* On a phone the time goes under the line, so the title keeps the width. */
@media (max-width: 480px) {
  html.ui-v2 .pf-note { grid-template-columns: 16px minmax(0, 1fr); grid-template-areas: "glyph copy" "glyph time"; row-gap: 4px; }
  html.ui-v2 .pf-note-glyph { grid-area: glyph; }
  html.ui-v2 .pf-note-copy { grid-area: copy; }
  html.ui-v2 .pf-note time { grid-area: time; line-height: 1.4; }
}

/* ---------------------------------------------------------------- usage */

html.ui-v2 .pf-usage-page { padding-bottom: 40px; }
html.ui-v2 .pf-usage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
html.ui-v2 .pf-usage-wide { grid-column: 1 / -1; }
html.ui-v2 .pf-usage-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 22px; border-radius: 16px; background: var(--pf-panel); }
html.ui-v2 .pf-usage-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
html.ui-v2 .pf-usage-card h2 { margin: 0; font-size: 15px; font-weight: 640; letter-spacing: -.01em; white-space: nowrap; }
html.ui-v2 .pf-usage-figure { display: flex; align-items: baseline; gap: 8px; margin: 0; min-width: 0; }
html.ui-v2 .pf-usage-figure b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
html.ui-v2 .pf-usage-figure span { font-size: 13px; color: var(--pf-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ui-v2 .pf-usage-meter { height: 8px; border-radius: 4px; background: #1b1d25; overflow: hidden; }
html.ui-v2 .pf-usage-meter i { display: block; height: 100%; border-radius: inherit; background: var(--v2-accent); }
html.ui-v2 .pf-usage-meter i[data-tone="warn"] { background: var(--pf-warn, #f5c26b); }
html.ui-v2 .pf-usage-meter i[data-tone="bad"] { background: var(--pf-bad); }
html.ui-v2 .pf-usage-meter.is-empty i { width: 0; }
/* A figure with no ceiling keeps the row's rhythm without drawing a track. */
html.ui-v2 .pf-usage-meter.is-none { visibility: hidden; }
html.ui-v2 .pf-usage-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; }
html.ui-v2 .pf-usage-card li { font-size: 13px; color: var(--pf-dim); line-height: 1.45; text-wrap: pretty; }
@media (max-width: 1000px) {
  html.ui-v2 .pf-usage-grid { grid-template-columns: minmax(0, 1fr); }
  /* Stacked, no card sits beside another, so an absent track takes no room. */
  html.ui-v2 .pf-usage-meter.is-none { display: none; }
}
@media (max-width: 480px) {
  html.ui-v2 .pf-usage-card { padding: 18px 16px; }
  html.ui-v2 .pf-usage-figure b { font-size: 26px; }
}

/* --------------------------------------------- not found, not allowed */

html.ui-v2 .pf-state-page {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  max-width: 560px; padding: 8px 0 40px;
}
html.ui-v2 .pf-state-page .pf-h1 { margin: 4px 0 0; }
html.ui-v2 .pf-state-page p { margin: 0 0 8px; color: var(--pf-dim); font-size: 14.5px; line-height: 1.55; text-wrap: pretty; }
html.ui-v2 .pf-state-glyph { display: grid; place-items: center; color: var(--v2-accent); }
html.ui-v2 .pf-state-glyph svg { width: 28px; height: 28px; }

/* --------------------------------------------------- the account menu */

html.ui-v2 .pf-am-who { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px 10px; }
html.ui-v2 .pf-am-who .pf-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
html.ui-v2 .pf-am-who-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
html.ui-v2 .pf-am-who-copy span { font-size: 11px; color: var(--pf-dimmer); }
html.ui-v2 .pf-am-who-copy b { font-size: 13px; font-weight: 600; color: var(--pf-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
