/* ============================================================
   Alpha Finance terminal: My Terminal (/my-terminal/)

   On top of the Overview's panel language (alpha.css, terminal.css's .ov
   rules and overview.css): the header bar, the panel grid with its five
   sizes, edit mode (tools, drag, add tiles), the catalogue sheet, the
   settings popover, the account menu and the sign-in dialog, which
   borrows the Report a bug dialog's frame from terminal.css.
   ============================================================ */

/* ---------- header ---------- */

.mt-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.mt-title { flex: 1 1 420px; min-width: 0; }
.mt-bar { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.mt-sync { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.mt-sync.is-saving .s::after, .mt-sync.is-loading .s::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%;
  background: var(--lime-dim); vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite; order: -1;
}
.mt-sync.is-saved .s::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--pos); order: -1; }
.mt-sync.is-error { color: var(--heat); }
.mt-sync .n { color: var(--text-2); }
.mt-sync .n + .s::before { content: "·"; margin: 0 8px; color: var(--faint); }
.mt-sync .s { display: inline-flex; align-items: center; }

.mt-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: none;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--text-2);
  cursor: pointer; white-space: nowrap;
}
.mt-btn svg { width: 14px; height: 14px; flex: none; }
.mt-btn:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.mt-btn.is-go { border-color: var(--lime); color: var(--lime); }
.mt-btn.is-go:hover:not(:disabled) { background: color-mix(in srgb, var(--lime) 12%, transparent); color: var(--lime); }
.mt-btn:disabled { opacity: 0.45; cursor: default; }
/* Start over shows only while customizing, and turns red once armed */
.mt-reset { display: none; }
body.mt-editing .mt-reset { display: inline-flex; }
.mt-reset:hover:not(:disabled) { color: var(--neg-text); border-color: color-mix(in srgb, var(--neg) 60%, var(--line-2)); }
.mt-reset.is-armed, .mt-reset.is-armed:hover:not(:disabled) { color: var(--neg-text); border-color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); }
.mt-btn.is-done { background: var(--lime); border-color: var(--lime); color: #0a0b0d; }
.mt-btn.is-done:hover:not(:disabled) { background: var(--lime); color: #0a0b0d; filter: brightness(1.08); }
.mt-btn:focus-visible, .mt-x:focus-visible, .mt-tools button:focus-visible { outline: 1px solid var(--lime-dim); outline-offset: 1px; }

.mt-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex: none;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
.mt-x:hover { color: var(--text); background: var(--panel-2); }
.mt-x svg { width: 15px; height: 15px; }

/* ---------- the guest strip ---------- */

.mt-guest {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 22px 0; padding: 9px 10px 9px 14px;
  border: 1px solid color-mix(in srgb, var(--lime) 28%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--lime) 4%, var(--panel));
}
.mt-guest[hidden] { display: none; }
.mt-guest .ic { display: flex; width: 16px; height: 16px; color: var(--lime); flex: none; }
.mt-guest .ic svg { width: 100%; height: 100%; }
.mt-guest p { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.mt-guest p b { color: var(--text); font-weight: 600; }

/* ---------- the board: one twelve-column grid of 36px rows ----------
   js/myterm.js places every tile with grid-column and grid-row, so the
   grid itself does the pixel arithmetic at any width; --cols drops to six
   and two on narrower screens, where the script lays the same tiles out in
   reading order. */

.mt-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols, 12), minmax(0, 1fr));
  grid-auto-rows: 36px;
  gap: 10px;
}
.mt-grid.is-empty { display: block; }
.mt-t { position: relative; min-width: 0; min-height: 0; }

/* panels fill their cells: the body takes whatever the head and foot leave */
body.term .mt-p { display: flex; flex-direction: column; height: 100%; margin: 0; container-type: inline-size; }
body.term .mt-p .panel-body { flex: 1 1 auto; height: auto; min-height: 0; overflow: hidden; position: relative; }
body.term .mt-p .panel-body.is-map, body.term .ov .mt-p.heromap .panel-body.is-map { height: auto; }
body.term .mt-p .panel-body.is-scroll { overflow-y: auto; scrollbar-width: thin; padding-top: 4px; padding-bottom: 6px; }
body.term .mt-p.ov-prices .panel-body { overflow-y: auto; scrollbar-width: thin; }
.mt-p .ov-rpmap { inset: 10px 12px 8px; }
.mt-p .panel-head { gap: 8px; }
.mt-p .panel-head h3 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-p .panel-head .ph-note[hidden] { display: none; }
.mt-p .panel-head .ph-note:not([hidden]), .mt-p .panel-head .ph-seg { margin-left: auto; }
.mt-p .panel-head .ph-note:not([hidden]) + .view, .mt-p .panel-head .ph-seg + .view { margin-left: 14px; }
/* a narrow panel keeps its title and settings; the live badge goes first */
@container (max-width: 420px) {
  .mt-p .panel-head .badge { display: none; }
}

/* stats fill their two rows too */
.mt-c { display: grid; container-type: inline-size; }
/* a narrow stat drops its small chart so its label and figure keep the width */
@container (max-width: 220px) {
  .mt-c > .pulse { grid-template-areas: "label label" "value value" "sub sub"; }
  .mt-c > .pulse .pg { display: none; }
}
.mt-c > .pulse { height: 100%; min-width: 0; align-content: center; }

/* the settings in a panel's head: its coin, asset or window as small buttons */
.ph-pills { display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.ph-pill {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 22px; padding: 0 7px 0 8px;
  border: 1px solid var(--line-2); border-radius: 5px;
  background: var(--panel-2);
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--text); cursor: pointer; white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
.ph-pill:hover { border-color: var(--muted); background: color-mix(in srgb, var(--lime) 4%, var(--panel-2)); }
.ph-pill:focus-visible { outline: 1px solid var(--lime-dim); outline-offset: 1px; }
.ph-pill span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.ph-pill .ph-caret { width: 8px; height: 5px; color: var(--muted); flex: none; }
.ph-pill.is-add { background: none; border-style: dashed; color: var(--text-2); }
/* a stat's setting leads its label: smaller, in the label's small caps */
.pulse .pl .ph-pill.is-sm { height: 18px; padding: 0 5px 0 6px; font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 1px; }
.pulse .pl .ph-pill.is-sm .ph-caret { width: 7px; height: 4px; }
.mt-c > .pulse[data-href] { cursor: pointer; }
.mt-c > .pulse:focus-visible { outline: 1px solid var(--lime-dim); outline-offset: 2px; }
body.mt-editing .mt-c > .pulse { cursor: grab; }

/* the watchlist */
.wl { display: flex; flex-direction: column; }
.wl-h, .wl-r {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 62px 76px;
  align-items: center;
  gap: 8px;
}
.wl.is-wide .wl-h, .wl-h:has(+ .wl-r.is-wide), .wl-r.is-wide { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(64px, 1fr)) minmax(80px, 1.2fr); gap: 16px; }
.wl-r.is-wide .wl-sp, .wl-h:has(+ .wl-r.is-wide) > span:last-child { margin-left: auto; }
.wl-r.is-wide .wl-sp { width: 100%; max-width: 140px; height: 22px; }
.wl-h {
  padding: 0 2px 6px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.wl-r {
  padding: 6px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  color: var(--text); text-decoration: none;
  font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.wl-r:last-child { border-bottom: 0; }
.wl-r:hover { background: var(--panel-2); }
.wl-r .r, .wl-h .r { text-align: right; }
.wl-n { display: flex; align-items: center; gap: 8px; min-width: 0; font-family: var(--sans); }
.wl-n img { flex: none; border-radius: 50%; }
.wl-n b { font-family: var(--display); font-size: 12.5px; font-weight: 600; }
.wl-n small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-p { color: var(--text); }
.wl-sp { display: block; margin-left: auto; }
.wl .up { color: var(--pos-text); }
.wl .down { color: var(--neg-text); }

/* ---------- Customize: grip, menu and remove in the head, resize in the corner ---------- */

.mt-grip, .mt-tools, .mt-rs, .mt-sbar { display: none; }
body.mt-editing .mt-t { outline: 1px dashed var(--line-2); outline-offset: 2px; }
body.mt-editing .mt-t:hover { outline-color: var(--muted); }
body.mt-editing .mt-p .panel-head .view, body.mt-editing .mt-p .panel-head .badge { display: none; }
body.mt-editing .mt-grid a { cursor: default; }

body.mt-editing .mt-tools { display: inline-flex; align-items: center; gap: 1px; margin-left: auto; flex: none; }
body.mt-editing .mt-p .panel-head .ph-note:not([hidden]) { margin-left: 8px; }
.mt-tools button { display: inline-flex; }
.mt-tools button, .mt-grip {
  align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none;
  border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer;
}
.mt-tools button:hover, .mt-grip:hover { color: var(--text); background: var(--panel-2); }
.mt-tools button svg, .mt-grip svg { width: 14px; height: 14px; display: block; }
.mt-tools [data-act="remove"]:hover { color: var(--neg-text); }
/* the width switch: a third, a half, two thirds, the whole row */
.mt-widths { display: inline-flex; margin-right: 6px; border: 1px solid var(--line-2); border-radius: 5px; overflow: hidden; }
.mt-tools .mt-widths button {
  width: auto; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 0;
  border-left: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.mt-tools .mt-widths button:first-child { border-left: 0; }
.mt-tools .mt-widths button[aria-pressed="true"] { background: color-mix(in srgb, var(--lime) 14%, transparent); color: var(--lime); }
/* while arranging, the head's settings make way for the layout controls */
body.mt-editing .mt-p .ph-pills { display: none; }
body:not(.mt-full) .mt-widths { display: none; }
.mt-tools button:focus-visible, .mt-grip:focus-visible, .mt-rs:focus-visible { outline: 1px solid var(--lime-dim); outline-offset: 1px; }
/* the grip moves a tile on the full grid; narrower, moving is in the tile's menu */
body.mt-editing.mt-full .mt-grip { display: inline-flex; cursor: grab; touch-action: none; }
/* on the full grid the whole head drags a panel, the whole tile a stat */
body.mt-editing.mt-full .mt-p .panel-head, body.mt-editing.mt-full .mt-c > .pulse { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
body.mt-editing.mt-full .mt-p .panel-head button, body.mt-editing.mt-full .ph-pills { cursor: pointer; }
body.mt-editing .mt-grid a, body.mt-editing .mt-grid img { -webkit-user-drag: none; }
body.mt-editing.mt-full .mt-rs {
  display: flex; align-items: flex-end; justify-content: flex-end;
  position: absolute; right: 0; bottom: 0; z-index: 3;
  width: 22px; height: 22px; padding: 3px;
  border: 0; background: none; color: var(--muted); cursor: nwse-resize; touch-action: none;
}
body.mt-editing.mt-full .mt-rs:hover { color: var(--lime); }
.mt-rs svg { width: 11px; height: 11px; display: block; }
.mt-c .mt-rs { cursor: ew-resize !important; }

/* a stat's controls sit in a small bar over its top-right corner */
body.mt-editing .mt-sbar {
  display: inline-flex; align-items: center; gap: 1px;
  position: absolute; top: 4px; right: 4px; z-index: 3;
  padding: 1px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
body.mt-editing .mt-sbar .mt-tools { margin-left: 0; }
.mt-sbar button { width: 24px; height: 22px; }

/* dragging and resizing */
.mt-t.is-drag { z-index: 50; transition: none !important; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); pointer-events: none; }
body.mt-editing .mt-t.is-drag { outline: 1px solid var(--lime-dim); }
body.mt-editing .mt-t.is-sizing { outline: 1px solid var(--lime-dim); z-index: 5; }
.mt-ph { border: 1px dashed var(--lime-dim); border-radius: 6px; background: color-mix(in srgb, var(--lime) 5%, transparent); }
body.mt-dragging, body.mt-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.mt-t.is-new { animation: mt-new 1.6s ease-out; }
@keyframes mt-new { 0% { box-shadow: 0 0 0 2px var(--lime); } 100% { box-shadow: 0 0 0 2px transparent; } }

/* ---------- the setup screen: the first look, and an emptied board ---------- */

body.mt-bare #mt-edit, body.mt-bare #mt-addp, body.mt-bare #mt-reset, body.mt-bare .mt-guest, body.mt-bare .mt-sync { display: none; }
.mt-empty { padding: 30px 26px 28px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.mt-setup-h { max-width: 560px; margin: 0 auto 24px; text-align: center; }
.mt-setup-h h2 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.mt-setup-h p { margin-top: 7px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.mt-setup-foot { margin-top: 20px; text-align: center; font-size: 12.5px; color: var(--muted); }
.mt-setup-foot .mt-link { font-size: 12.5px; color: var(--lime); }
.mt-loading { text-align: center; padding: 60px 20px; }
.mt-loading p { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }

.mt-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; text-align: left; }
.mt-preset {
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 12px 13px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel);
  font-family: var(--sans); text-align: left; color: var(--text); cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.mt-preset:hover { border-color: var(--lime-dim); background: color-mix(in srgb, var(--lime) 3%, var(--panel)); transform: translateY(-1px); }
.mt-preset:focus-visible { outline: 1px solid var(--lime); outline-offset: 2px; }
.mt-preset b { font-family: var(--display); font-size: 13.5px; font-weight: 600; }
.mt-preset > span:not(.mt-thumb) { font-size: 12px; line-height: 1.4; color: var(--text-2); }
.mt-preset small { margin-top: auto; padding-top: 2px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--muted); }
.mt-preset.is-blank { border-style: dashed; background: none; }
.mt-preset.is-armed { border-color: var(--heat); }
.mt-preset.is-armed small { color: var(--heat); }

/* the sketch of a preset's layout */
.mt-thumb { display: flex; align-items: center; justify-content: center; height: 104px; margin-bottom: 6px; padding: 10px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); }
.mt-thumb svg { display: block; width: 100%; height: 100%; }
.mt-thumb .c { fill: var(--line-2); }
.mt-thumb .p { fill: var(--panel-2); stroke: var(--line-2); stroke-width: 1; }
.mt-thumb .p.is-chart { fill: color-mix(in srgb, var(--lime) 7%, var(--panel-2)); }
.mt-thumb .ln { fill: none; stroke: var(--lime-dim); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; opacity: 0.8; }
.mt-thumb .l { fill: var(--line-2); }
.mt-thumb .gap { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; }
.mt-thumb .plus { stroke: var(--lime-dim); stroke-width: 1.6; stroke-linecap: round; }
.mt-preset:hover .mt-thumb .gap { stroke: var(--lime-dim); }

/* in the catalogue sheet the presets are a list: sketch left, words right */
.mt-presets.is-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mt-presets.is-list .mt-preset { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 14px; row-gap: 3px; }
.mt-presets.is-list .mt-thumb { grid-row: 1 / 4; height: 70px; margin: 0; padding: 7px; align-self: start; }
.mt-presets.is-list small { margin-top: 2px; }

/* ---------- the first-visit tip ---------- */

.mt-tip {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 22px 0; padding: 9px 8px 9px 14px;
  border: 1px solid color-mix(in srgb, var(--lime) 40%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--lime) 6%, var(--panel));
  animation: mt-in 0.25s ease-out;
}
.mt-tip[hidden] { display: none; }
.mt-tip p { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.mt-tip p b { color: var(--text); font-weight: 600; }

/* ---------- the catalogue sheet ---------- */

.mt-sheet {
  position: fixed; inset: 0; z-index: 90;
  display: flex; justify-content: flex-end;
  background: rgba(4, 5, 7, 0.5);
}
.mt-sheet[hidden] { display: none; }
.mt-sheet-in {
  display: flex; flex-direction: column;
  width: min(520px, 100%); height: 100%;
  border-left: 1px solid var(--line-2);
  background: var(--bg-2);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.45);
  animation: mt-in 0.18s ease-out;
}
@keyframes mt-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.mt-sheet-head { display: flex; align-items: center; padding: 16px 14px 10px 18px; }
.mt-sheet-head h2 { flex: 1; font-family: var(--display); font-size: 16px; font-weight: 700; }
.mt-sheet-tools { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 12px; border-bottom: 1px solid var(--line); }
.mt-sheet-tools .seg { align-self: flex-start; }
.mt-sheet-tools input, .mt-pop input[type=search], .mt-row input {
  width: 100%; height: 32px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--panel); color: var(--text);
  font-family: var(--sans); font-size: 12.5px;
  outline: none;
}
.mt-sheet-tools input:focus, .mt-pop input:focus, .mt-row input:focus { border-color: var(--muted); }
.mt-sheet-tools input[hidden] { display: none; }
.mt-sheet-body { flex: 1; overflow-y: auto; padding: 6px 18px 30px; scrollbar-width: thin; }
.mt-cat-h {
  margin: 18px 0 6px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
/* the catalogue's cards: a sketch of the panel, its name and what it shows */
.mt-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mt-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 9px 9px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel);
  font-family: var(--sans); text-align: left; color: var(--text); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mt-card:hover:not(:disabled) { border-color: var(--lime-dim); background: color-mix(in srgb, var(--lime) 3%, var(--panel)); }
.mt-card:focus-visible { outline: 1px solid var(--lime); outline-offset: 2px; }
.mt-card:disabled { opacity: 0.55; cursor: default; }
.mt-pv { display: block; padding: 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg-2); }
.mt-pv svg { display: block; width: 100%; height: auto; }
.mt-pv .l { fill: var(--line-2); }
.mt-pv .l2 { fill: var(--line); }
.mt-pv .b { fill: color-mix(in srgb, var(--lime) 50%, var(--panel-2)); }
.mt-pv .d, .mt-pv .img { fill: var(--line-2); }
.mt-pv .up { fill: color-mix(in srgb, var(--pos) 80%, transparent); }
.mt-pv .dn { fill: color-mix(in srgb, var(--neg) 80%, transparent); }
.mt-pv .ln { fill: none; stroke: var(--lime-dim); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.mt-pv .ln2 { fill: none; stroke: #3987e5; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; opacity: 0.8; }
.mt-pv .ar { fill: color-mix(in srgb, var(--lime) 10%, transparent); }
.mt-pv .h0 { fill: color-mix(in srgb, var(--lime) 55%, transparent); }
.mt-pv .h1 { fill: color-mix(in srgb, #3fd6ae 40%, transparent); }
.mt-pv .h2 { fill: color-mix(in srgb, #3987e5 45%, transparent); }
.mt-pv .t0 { fill: color-mix(in srgb, var(--pos) 55%, var(--panel-2)); }
.mt-pv .t1 { fill: color-mix(in srgb, var(--neg) 45%, var(--panel-2)); }
.mt-pv .t2 { fill: var(--line-2); }
.mt-pv .gt { fill: none; stroke: var(--line-2); stroke-width: 6; stroke-linecap: round; }
.mt-pv .gv { fill: none; stroke: #6fa952; stroke-width: 6; stroke-linecap: round; }
.mt-pv .z0 { fill: #2ea98e; } .mt-pv .z1 { fill: #6fa952; } .mt-pv .z2 { fill: #6b727c; } .mt-pv .z3 { fill: #c9744f; }
.mt-pv .mk { fill: var(--text); }
.mt-card-t { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mt-card-t .ic { display: flex; width: 14px; height: 14px; color: var(--muted); flex: none; }
.mt-card-t .ic svg { width: 100%; height: 100%; }
.mt-card-t b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-card small { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.mt-card-a { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 2px; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--lime); }
.mt-card-a svg { width: 12px; height: 12px; }
.mt-card:disabled .mt-card-a { color: var(--muted); }
.mt-card.is-on { border-style: dashed; background: none; }
.mt-card.is-on .mt-card-a { color: var(--text-2); }
.mt-card.is-on:hover .mt-card-a { color: var(--lime); }
.mt-cat-note { margin: 14px 0 4px; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.mt-sheet .mt-presets { margin-top: 12px; }

/* ---------- the settings popover and the account menu ---------- */

.mt-pop, .mt-menu {
  position: fixed; z-index: 95;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.mt-pop[hidden], .mt-menu[hidden] { display: none; }
.mt-pop { width: min(300px, calc(100vw - 20px)); padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 12px; }
.mt-pop-h { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.mt-pop-h b { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-f { display: flex; flex-direction: column; gap: 6px; }
.mt-f .bug-l small { margin-left: 4px; }
.mt-f select {
  height: 32px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--panel-2); color: var(--text);
  font-family: var(--sans); font-size: 12.5px;
}
.mt-f .seg { align-self: flex-start; }
/* one pill's choices, as a list with a tick */
.mt-pop.is-one { width: min(230px, calc(100vw - 20px)); }
.mt-pop.is-one:has([data-coins]) { width: min(290px, calc(100vw - 20px)); }
.mt-choices { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; margin: -4px -6px 0; scrollbar-width: thin; }
.mt-choices button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 8px; border: 0; border-radius: 4px; background: none;
  font-family: var(--sans); font-size: 12.5px; text-align: left; color: var(--text-2); cursor: pointer;
}
.mt-choices button:hover { background: var(--panel-2); color: var(--text); }
.mt-choices button[aria-selected="true"] { color: var(--text); font-weight: 600; }
.mt-choices .ck { display: flex; width: 14px; height: 14px; color: var(--lime); }
.mt-choices .ck svg { width: 100%; height: 100%; }
.mt-count { font-family: var(--mono); font-size: 10px; letter-spacing: 0.03em; color: var(--muted); }
.mt-coins { max-height: 236px; overflow-y: auto; margin: 0 -4px; scrollbar-width: thin; }
.mt-coins button {
  display: grid; grid-template-columns: 18px 52px minmax(0, 1fr) 16px; align-items: center; gap: 8px;
  width: 100%; padding: 6px 4px;
  border: 0; border-radius: 4px; background: none;
  font-family: var(--sans); font-size: 12px; text-align: left; color: var(--text-2); cursor: pointer;
}
.mt-coins button:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.mt-coins button:disabled { opacity: 0.35; cursor: default; }
.mt-coins button img, .mt-coins button i { width: 16px; height: 16px; border-radius: 50%; background: var(--panel-2); }
.mt-coins button b { font-family: var(--display); font-weight: 600; color: var(--text); }
.mt-coins button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-coins .ck { display: flex; width: 16px; height: 16px; color: var(--lime); }
.mt-coins .ck svg { width: 100%; height: 100%; }
.mt-coins button[aria-selected="true"] { color: var(--text); }

.mt-menu { min-width: 220px; padding: 6px; display: flex; flex-direction: column; }
.mt-menu-who { padding: 6px 8px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.mt-menu-who b { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-menu button {
  padding: 8px; border: 0; border-radius: 4px; background: none;
  font-family: var(--sans); font-size: 12.5px; text-align: left; color: var(--text-2); cursor: pointer;
}
.mt-menu button:hover, .mt-menu button:focus-visible { background: var(--panel-2); color: var(--text); outline: none; }
.mt-menu button.is-bad:hover, .mt-menu button.is-bad:focus-visible { color: var(--neg-text); }
.mt-menu button:disabled { opacity: 0.4; cursor: default; }

/* ---------- sign in ---------- */

.mt-modal { z-index: 120; }
.mt-signin-body { gap: 14px; }
.mt-step[hidden] { display: none; }
.mt-step { display: flex; flex-direction: column; gap: 14px; }
.mt-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 40px; width: 100%;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: #f4f5f6; color: #1f1f1f;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
.mt-google:hover:not(:disabled) { background: #fff; }
.mt-google:disabled { opacity: 0.6; cursor: default; }
.mt-google[hidden], .mt-or[hidden] { display: none; }
.mt-or { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.mt-or::before, .mt-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mt-mail { display: flex; flex-direction: column; gap: 6px; }
.mt-row { display: flex; gap: 8px; }
.mt-row input { height: 32px; flex: 1; min-width: 0; }
.mt-row .bug-b { height: 32px; }
#mt-otp { font-family: var(--mono); letter-spacing: 0.2em; }
.mt-sent { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.mt-sent b { color: var(--text); font-weight: 600; word-break: break-all; }
.mt-link { align-self: flex-start; padding: 0; border: 0; background: none; font-family: var(--sans); font-size: 12px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.mt-link:hover { color: var(--text); }
.mt-err { margin: 0 14px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--heat) 40%, transparent); border-radius: 5px; font-size: 12px; line-height: 1.45; color: var(--heat); }
.mt-signin-body .mt-err { margin: 0; }
.mt-err[hidden] { display: none; }
.mt-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.mt-check input { accent-color: var(--lime); width: 14px; height: 14px; }
.mt-fine .bug-note { margin-right: 0; line-height: 1.5; }
.bug-b.is-bad { border-color: var(--neg); color: var(--neg-text); }
.bug-b.is-bad:hover:not(:disabled) { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg-text); }
.bug-b:disabled { opacity: 0.5; cursor: default; }
.mt-warn-ic { color: var(--neg-text) !important; }

/* ---------- widths ---------- */

@media (max-width: 1180px) {
  .mt-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .mt-guest, .mt-tip { margin: 12px 14px 0; }
  .mt-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .mt-head { align-items: flex-start; gap: 12px; }
  .mt-bar { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .mt-sync { margin-right: auto; }
  .mt-guest { flex-wrap: wrap; }
  .mt-guest p { flex-basis: calc(100% - 60px); }
  .mt-presets { grid-template-columns: minmax(0, 1fr); }
  .mt-cards { grid-template-columns: minmax(0, 1fr); }
  .mt-sheet-in { width: 100%; border-left: 0; }
  /* controls bigger for a thumb */
  .mt-tools button { width: 32px; height: 30px; }
  .wl-h, .wl-r { grid-template-columns: minmax(0, 1fr) 80px 58px 64px; }
  .wl-r.is-wide, .wl-h:has(+ .wl-r.is-wide) { grid-template-columns: minmax(0, 1fr) 80px 58px 64px; }
  .wl-r.is-wide > span:nth-child(4), .wl-h:has(+ .wl-r.is-wide) > span:nth-child(4) { display: none; }
}
/* phones: the email box gets the full row, the button sits under it */
@media (max-width: 480px) {
  .mt-row { flex-direction: column; }
  .mt-row .bug-b { height: 38px; flex: none; }
  .mt-row input { height: 38px; flex: none; }
}
