/* dialogs.css — Settings, notifications and the open-items menu.
   Split from styles.css at its original section boundary; order is unchanged. */
/* -------------------------------------------------------------- other screens --- */
.settings, .history-page { display: flex; flex-direction: column; gap: 14px; }
.scard {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.scard h2, .section-head h2 { font-size: var(--text-body); font-weight: var(--fw-medium); }
.scard p, .sub { color: var(--ink-3); font-size: var(--text-label); }
.scard-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings { max-width: 720px; }
.sbtn, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center;
  height: 34px; padding: 0 13px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: var(--text-label); cursor: pointer;
}
.sbtn:hover, .btn:hover { border-color: var(--line-strong); color: var(--ink); }
/* A form's submit is the height of the field it sends. The account screen's
   pair sat 4px shorter than their own inputs, so a field and its action read as
   two different kinds of control on the same line. */
.passform .sbtn { height: 38px; }
/* The saved-view row is one pair too: the name field is 32, so Save is 32. */
.sbtn.danger { color: var(--down); border-color: rgba(255, 133, 140, .3); }

/* modals */
.ascrim, #async-scrim {
  position: fixed; inset: 0; z-index: 100;
  background: var(--scrim);
  backdrop-filter: none;
}
.amodal-box, .auth-card {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 60px);
  overflow: auto;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--card);
  box-shadow: 0 40px 100px -40px #000;
}
.amodal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.amodal-h h2 { font-size: var(--text-body); font-weight: var(--fw-medium); }
.amodal-body { display: flex; flex-direction: column; gap: 10px; }
.adel {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: var(--field);
  color: var(--ink-3); cursor: pointer; font-size: var(--text-body);
}
.adel:hover { color: var(--ink); }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="url"], textarea, select {
  font-family: var(--sans); font-weight: var(--fw-regular);
}
form label { color: var(--ink-3); font-size: var(--text-label); }

fieldset { border: 0; padding: 0; margin: 0; }

/* generic list rows used across the panes and screens */
.alert-row, .acfg-row, .fill-row, .nrow {
  border-bottom: 1px solid var(--line-soft);
}

/* misc utility text */
.eyebrow { color: var(--ink-4); font-size: var(--text-label); letter-spacing: var(--track-label); text-transform: none; }
.quiet { color: var(--ink-4); }
.fine { color: var(--ink-4); font-size: var(--text-label); }

/* --------------------------------------------------------------- notif drawer --- */
.notif-drawer {
  position: fixed; left: 88px; bottom: 88px; z-index: 120;
  width: 340px; max-height: min(480px, calc(100dvh - 120px));
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.notif-drawer[hidden] { display: none; }
/* The rail's corner is the phone's placement, where the Alerts pane opens the
   record. From 621px the page head carries the bell, so the drawer hangs from
   that corner instead of crossing the board to the rail. */
@media (min-width: 621px) {
  .notif-drawer {
    left: auto;    right: calc(28px + var(--shell-gutter, 0px));
    top: 66px; bottom: auto;
  }
}
@media (min-width: 621px) and (max-width: 860px) {
  .notif-drawer { right: calc(18px + var(--shell-gutter, 0px)); }
}
/* The Alerts pane owns the record on a phone, where the header bell is gone. */
.alerts-head-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* The record's mark sits in the head beside the plus the other two heads carry,
   so it is the same ghost box: one line, one fill and the same 30px height,
   rather than a bordered circle that made the alerts head the odd one. */
.alerts-notif {
  display: none; position: relative;
  width: 30px; height: 30px; padding: 0; place-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2); color: var(--ink-3); cursor: pointer;
}
.alerts-notif:hover { color: var(--ink); border-color: var(--line-strong); }
.alerts-notif-count {
  font-weight: var(--fw-medium);
  position: absolute; top: -3px; right: -3px;
  min-width: 15px; height: 15px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-family: var(--mono); font-size: var(--text-label); line-height: 1;
}
.alerts-notif-count[hidden] { display: none; }
.nd-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.nd-head h2 { font-size: var(--text-body); font-weight: var(--fw-medium); }
.nd-x { width: 26px; height: 26px; border: 0; border-radius: 5px; background: var(--field); color: var(--ink-3); cursor: pointer; }
.nd-body { flex: 1 1 auto; overflow: auto; padding: 8px; }
.nd-foot { padding: 8px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* The drawer is the record at the bell; the page is the record at the width of
   the board. The foot is the way from one to the other. */
.nd-all { display: inline-flex; align-items: center; text-decoration: none; }
.nd-note { color: var(--ink-4); font-size: var(--text-label); padding: 10px; }
#nd-clear.armed { color: var(--down); border-color: rgba(255, 133, 140, .4); }

/* One firing, wherever the record is read: the bell's drawer or the full
   notifications screen. The dot is the unread mark; the row is the way into
   the item it was about. */
.nday {
  padding: 14px 20px 6px;
  color: var(--ink-4); font-size: var(--text-label); font-weight: var(--fw-medium);
  letter-spacing: var(--track-label); text-transform: none;
}
.nwrap { display: block; }
.nrow {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 20px;
  border: 0; border-bottom: 1px solid var(--line-soft);
  background: transparent; color: inherit;
  text-align: left; font: inherit; cursor: pointer;
  transition: background var(--t-quick);
}
div.nrow { cursor: default; }
button.nrow:hover { background: var(--hover); }
.nwrap.unread .nrow { background: rgba(255, 186, 0, .12); }
.nwrap:last-child .nrow { border-bottom: 0; }
.ndot {
  flex: 0 0 6px; width: 6px; height: 6px;
  border-radius: 999px; background: var(--line-strong);
}
.nwrap.unread .ndot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.n-ico {
  flex: 0 0 24px; width: 24px; height: 24px;
  display: grid; place-items: center;
  object-fit: contain; border-radius: 5px; background: var(--field);
  font-size: var(--text-label);
}
.ntext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ntext b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: var(--text-label); font-weight: var(--fw-medium);
}
.ntext span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-3); font-size: var(--text-label);
}
.nwhen {
  font-weight: var(--fw-medium);
  flex: 0 0 auto; margin-left: auto;
  color: var(--ink-4); font-family: var(--mono); font-size: var(--text-label);
}
.nd-body .nday { padding: 10px 10px 4px; }
.nd-body .nrow { padding: 8px 10px; }

/* The board's copy of the record: a mast, then the card the width of the list. */
.hist-page {
  display: flex; flex-direction: column; gap: 18px;
  padding-bottom: 40px;
}
.hist-count {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: var(--text-label);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.hist {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
}
.hist-none { padding: 40px 20px 14px; text-align: center; color: var(--ink-4); font-size: var(--text-label); }
.hist .link { display: block; margin: 0 auto 32px; }

/* --------------------------------------------------------------- open items menu --- */
/* The list menu: one floating card, used three times - a star asks which list
   the item goes into, the panel's switch asks which list the table shows, and
   the watchlists pane's head asks which list that column reads. It sits on the
   page rather than in either layout, so the same card opens from a table row
   and from the panel without moving what it opened from. */
.listmenu {
  position: fixed;
  /* Above the column's drawer (65) and the board, under the search card and the
     open-items card: the picker is raised from inside the drawer as well as
     from the filters card, and a menu behind the sheet it was opened from is a
     menu nobody can press. */
  z-index: 70;
  min-width: 224px;
  max-width: 268px;
  /* The window, not a card-sized guess: the picker grew past 340 with the
     built-in views, and a scrollbar on a desk with room to spare is a control
     for a problem that is not there. It still scrolls on a short screen or a
     phone, where the content genuinely does not fit. */
  max-height: calc(100dvh - var(--kb, 0px) - 24px);
  overflow-y: auto;
  padding: 5px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  /* One step above the page it covers, and it says so in its own light: a
     hairline of it along the card's top edge and a shadow that only has to
     lift the card, not draw it. */
  box-shadow:
    inset 0 1px 0 var(--inset-line),
    0 22px 44px -22px rgba(7, 7, 7, .3);
}
/* The card's one title line: the question it answers, in the app's title voice,
   closed with a hairline so the rows begin cleanly. */
.lm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 4px;
  padding: 5px 8px 7px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: var(--text-label); font-weight: var(--fw-medium); letter-spacing: 0;
  color: var(--ink-3);
}
.lm-head-title { color: var(--ink-3); }
.lm-head-now {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
/* A row: the name as the press, its count at the far end, and the two verbs it
   owns in a pair of quiet glyphs. The ground is drawn one step in from the
   card's edge, so the rows read as a list of things rather than a stack of
   table rows. */
.lm-row {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 0;
  border-radius: 4px;
}
.lm-pick {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-2);
  font-size: var(--text-body);
  text-align: left;
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease);
}
@media (hover: hover) {
  .lm-pick:hover { background: var(--field); color: var(--ink); }
}

/* The row this card is already showing: the dot is the accent, the name is the
   page's own ink, and a wash of the accent holds it open after the pointer has
   gone. */
.lm-pick[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); }
/* A list the plan has banked keeps its name and press - one opens the Pro pitch,
   the other deletes it - but loses the ink and the sprite brightness of a list
   that can be read. The crown stays as the reason, muted with the rest. */
.lm-row.banked .lm-pick { color: var(--ink-4); }
.lm-row.banked .lm-name { font-weight: var(--fw-regular); }
.lm-row.banked .lm-ico { opacity: .55; filter: grayscale(1); }
.lm-row.banked .lm-n { opacity: .7; }
.lm-row.banked .lm-crown { color: var(--ink-4); opacity: .7; }
@media (hover: hover) {
  .lm-row.banked .lm-pick:hover { background: var(--field); color: var(--ink-3); }
}
.lm-pick:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--accent-line); }
.lm-tick {
  flex: 0 0 13px;
  width: 13px;
  font-size: var(--text-label);
  line-height: 1;
  text-align: center;
  color: var(--accent);
}
/* The view's own mark, in the column the board's sprites have: a watchlist's
   first saved item, a preset's first result, or a quiet line drawing when the
   view has no item to lend it one. */
.lm-ico {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.lm-ico .ico { width: 100%; height: 100%; display: grid; place-items: center; }
.lm-ico img {
  max-width: 20px; max-height: 20px;
  object-fit: contain;
  image-rendering: pixelated;
}
.lm-ico svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.lm-pick[aria-pressed="true"] .lm-ico { color: var(--accent); }

.lm-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* The names are read at the same 13px/500 as the board's own name column. */
  font-family: var(--sans);
  font-size: var(--text-body);
  font-weight: var(--fw-medium);
}
/* The rows are cut from the card's own plate: a 4px corner inside the 6px one,
   so the things in it belong to the card rather than sit on it. */
.lm-row, .lm-pick, .lm-new, .lm-tool { border-radius: 4px; }
.lm-n {
  font-weight: var(--fw-medium);
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: var(--text-label);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
/* The two verbs a list owns, in miniature. They are drawn, not faded in: a
   glyph nobody can see is not an affordance, and the right-click card behind
   them says the same two things in words. */
.lm-tool {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-3);
  font-size: var(--text-body);
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease);
}
@media (hover: hover) {
  .lm-tool:hover { background: var(--field); color: var(--ink); }
}

.lm-tool:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--accent-line); }
/* The row is a button, and a button shrinks to its words: without this "all
   items" was 62px of text in a 220px card, so a press on the rest of the row
   hit the card and did nothing - the one way back out of the preset was
   the one place that looked pressable and was not. */
.lm-all { width: 100%; margin-bottom: 4px; }
.lm-foot {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
  padding: 4px 0 0;
  border-top: 1px solid var(--line);
}
.lm-new {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-3);
  font-size: var(--text-body);
  text-align: left;
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease);
}
@media (hover: hover) {
  .lm-new:hover { background: var(--field); color: var(--ink); }
  .lm-new[data-save-view]:hover { background: var(--accent-soft); color: var(--accent); }
}
.lm-new.pro { color: var(--accent); }

.lm-new:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--accent-line); }
/* The right-click menu is a context menu, and it has to look like the one the
   browser raises: a narrow card at the pointer, the list it is about written
   dim across the top, then the two things that can be done to it, one under the
   other on full-width lines. */
.listmenu.ctx {
  min-width: 186px;
  max-width: 260px;
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 18px 40px -18px rgba(7, 7, 7, .3);
}
.ctx-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  padding: 4px 8px 7px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--text-label);
}
.ctx-head .lm-input { flex: 1 1 auto; width: 0; margin: 0; }
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink-2);
  font-size: var(--text-body);
  text-align: left;
} .ctx-item:focus{ background: var(--field); color: var(--ink); outline: 0; }
@media (hover: hover) {
  .ctx-item:hover { background: var(--field); color: var(--ink); outline: 0; }
}
 .ctx-item.del:focus{ color: var(--down); }
@media (hover: hover) {
  .ctx-item.del:hover { color: var(--down); }
}

/* The verb's own mark, the word, and the value it acts on: the icon row shows
   the sprite in force at the far end, so the card says what it would change
   before it is pressed. */
.ctx-glyph {
  flex: 0 0 16px;
  width: 16px; height: 16px;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.ctx-glyph svg { width: 15px; height: 15px; fill: none; stroke: currentColor; }
.ctx-item.del .ctx-glyph { color: var(--ink-4); }
@media (hover: hover) {
  .ctx-item.del:hover .ctx-glyph { color: var(--down); }
}
.ctx-word { flex: 1 1 auto; min-width: 0; }
.ctx-item .lm-ico { flex: 0 0 18px; width: 18px; height: 18px; }
.ctx-item .lm-ico img { max-width: 18px; max-height: 18px; }

/* The card's one field, and its delete question: a label over the input, then
   Save and Cancel in words - the same two presses on every screen. */
.ctx-form, .ctx-ask { display: grid; gap: 5px; padding: 2px 3px 4px; }
.ctx-field { display: grid; gap: 3px; }
.ctx-field-word { padding: 0 5px; font-size: var(--text-label); color: var(--ink-4); }
.ctx-form .lm-input { margin: 0; }
.ctx-question { margin: 2px 5px 0; font-size: var(--text-body); color: var(--ink); }
.ctx-sub { margin: 0 5px 3px; font-size: var(--text-label); line-height: var(--leading-label); color: var(--ink-4); }
.ctx-acts { display: flex; gap: 5px; }
.ctx-go, .ctx-ghost {
  flex: 1 1 auto;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: var(--text-body);
  font-weight: var(--fw-medium);
  cursor: pointer;
}
.ctx-go { border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.ctx-ghost { border: 1px solid var(--line); background: none; color: var(--ink-3); }
@media (hover: hover) {
  .ctx-go:hover { background: var(--accent); color: var(--card-2); }
  .ctx-ghost:hover { background: var(--field); color: var(--ink); }
}
.ctx-go.danger { border-color: var(--down); background: var(--down-soft); color: var(--down); }
@media (hover: hover) {
  .ctx-go.danger:hover { background: var(--down); color: var(--card-2); }
}
.ctx-go:focus-visible, .ctx-ghost:focus-visible {
  outline: 0; box-shadow: inset 0 0 0 1px var(--accent-line);
}

/* The icon picker is the row menu's third level: a field and the items it
   found, each drawn with the sprite it would pin. */
.ctx-icon-pick { display: grid; gap: 2px; }
.ctx-icon-pick .lm-input { margin: 2px 0 4px; }
.ctx-icon-results { max-height: 208px; overflow: auto; }
.ctx-icon-results .lm-pick { min-height: 30px; }
.lm-tool svg { display: block; width: 14px; height: 14px; margin: 0 auto; }
.ctx-head .lm-ico { align-self: center; }

/* The View picker holds two kinds of row - the lists, and the presets -
   and each kind says which it is in the head's voice, one step quieter. */
.lm-group {
  margin: 8px 0 2px;
  padding: 0 8px;
  font-family: var(--sans);
  font-size: var(--text-label); font-weight: var(--fw-medium); letter-spacing: 0;
  color: var(--ink-4);
}
.lm-group-sep { margin-top: 10px; }
.lm-empty {
  margin: 2px 8px 6px;
  color: var(--ink-4);
  font-size: var(--text-label);
  line-height: var(--leading-label);
}
.lm-saveform { display: flex; align-items: center; gap: 4px; }
.lm-saveform .lm-input { flex: 1 1 auto; margin: 2px 0; }
.lm-save { width: auto; flex: 0 0 auto; color: var(--accent); }
.lm-input {
  width: 100%;
  margin: 3px 0;
  padding: 6px 8px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-xs);
  background: var(--field);
  color: var(--ink);
  font-size: var(--text-body);
}
.lm-note { margin: 4px 7px 2px; font-size: var(--text-label); color: var(--accent); }

.items-menu {
  position: fixed; z-index: 95;
  width: 260px; max-height: 60vh; overflow: auto;
  padding: 7px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  box-shadow: var(--shadow);
}
.items-menu[hidden] { display: none; }
.items-menu .items-row { display: flex; align-items: center; gap: 6px; border-radius: 6px; }
.items-menu .items-row:hover { background: var(--field); }
.items-open {
  flex: 1 1 auto; display: flex; align-items: center; gap: 8px;
  padding: 8px; border: 0; background: none; color: var(--ink-2);
  font-size: var(--text-label); text-align: left; cursor: pointer;
}
.items-open img { width: 22px; height: 22px; object-fit: contain; }
.items-x { width: 26px; height: 26px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-4); cursor: pointer; }
.items-x:hover { background: var(--field-2); color: var(--ink); }

/* the item page's full-screen chart keeps the card shape */
.chart-wrap.full { position: fixed; inset: 0; z-index: 90; margin: 0; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.chart-wrap.full .chart { flex: 1 1 auto; min-height: 0; }
.chart-wrap.full .chart svg { height: 100%; }
.chart-wrap.full .chart.chart-margin { flex: 0 0 96px; }
.chart-wrap.full .chart-sub { flex: 0 0 auto; }
/* A phone's full-screen chart needs its frame: edge to edge, the card's rounded
   corners sit against the glass and read as cropped. The 12px inset keeps all
   four corners whole without giving up the card's full-height plot. */
@media (max-width: 620px) {
  .chart-wrap.full { inset: 12px; }
}

/* One control, one glyph: the button carries both the enter and leave icons so
   the press does not swap a node, and only the one that describes the next press
   is drawn. */
.fs-open .fs-in { display: none; }
.fs-open[aria-pressed="true"] .fs-out { display: none; }
.fs-open[aria-pressed="true"] .fs-in { display: block; }

