/* Shared look for the trades history (backtest.html) and the dashboard
   (dashboard.html) — TraderMake.Money-inspired: dense, light, one accent. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #f7f7f8; color: #1d1d1f;
  font: 13px/1.4 'Nordwand Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  -webkit-text-size-adjust: 100%;
}
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 1px; }

/* Same contrast ladder as the chart (index.html): #1d1d1f primary, #55555c
   secondary, #6b6b70 muted. The old #86868b sat at 3.5:1 on #fff and 3.4:1 on
   #f7f7f8 — it failed AA at the 11px sizes it was used at almost everywhere. */
:root { --muted: #6b6b70; --green: #0a7d34; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.tmm-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: #fff; border-bottom: 1px solid #e3e3e6;
}
.tmm-header h1 { font-size: 16px; font-weight: 650; margin: 0; }
.tmm-header .spacer { flex: 1; }
.tmm-nav { display: flex; gap: 12px; font-size: 13px; }
.tmm-nav a.active { color: #111; font-weight: 650; }
/* Phone: the filter row eats half the screen — it lives behind one button */
#filterToggle {
  display: none; height: 27px; padding: 0 10px; border: 1px solid #d5d5da;
  border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px;
}
@media (max-width: 700px) {
  #filterToggle { display: inline-flex; align-items: center; }
  #filterToggle.on { background: #111; color: #fff; border-color: #111; }
  /* `body` keeps this ahead of the base .filters rule below, whatever the order */
  body .filters { display: none; }
  body .filters.open { display: flex; }
}

/* ── Filters ─────────────────────────────────────────────────────────── */
.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; background: #fff; border-bottom: 1px solid #e3e3e6;
  position: static;
}
.filters label { display: flex; align-items: center; gap: 4px; color: #6b6b70; font-size: 12px; }
.filters select, .filters input[type=date], .filters input[type=text] {
  height: 27px; padding: 0 8px; border: 1px solid #d5d5da; border-radius: 4px; background: #fff;
}
.filters .date-field { display: inline-flex; align-items: center; gap: 2px; }
.filters #fFrom, .filters #fTo { width: 112px; }
.date-open {
  width: 24px; height: 27px; padding: 0; border: 1px solid #d5d5da; border-radius: 4px;
  background: #fff; color: #55555c; font-size: 13px; line-height: 1; cursor: pointer;
}
.date-open:hover { background: #f0f0f3; }

.filters label.check { gap: 5px; cursor: pointer; user-select: none; }
.filters #fShowAll { width: 13px; height: 13px; margin: 0; accent-color: #111; }
.filters button {
  height: 27px; padding: 0 10px; border: 1px solid #d5d5da; border-radius: 4px;
  background: #fff; cursor: pointer;
}
.filters button:hover { background: #f0f0f3; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px; border-radius: 4px;
  border: 1px solid #d5d5da; background: #fff; color: #444;
  font-size: 11px; cursor: pointer; white-space: nowrap;
}
.chip.on { background: #111; color: #fff; border-color: #111; }
.chip .x { opacity: .6; }

/* ── KPI cards ───────────────────────────────────────────────────────── */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px; padding: 12px 16px;
}
.kpi {
  background: #fff; border: 1px solid #e6e6ea; border-radius: 10px; padding: 9px 11px;
}
.kpi .v { font-size: 19px; font-weight: 680; letter-spacing: -.2px; }
.kpi .l { font-size: 11px; color: #6b6b70; margin-top: 1px; }
.pos { color: #0a7d34; }
.neg { color: #d1232a; }
.muted { color: #6b6b70; }

/* ── Trade table ─────────────────────────────────────────────────────── */
.table-wrap { padding: 0 16px 90px; }
table.trades { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
  border: 1px solid #e6e6ea; border-radius: 10px; }
.trades th {
  position: sticky; top: var(--trades-sticky-top, 44px); z-index: 10;
  background: #fbfbfc; border-bottom: 1px solid #ececf0;
  font-size: 11px; font-weight: 600; color: #6b6b70; text-align: left;
  padding: 8px 10px; white-space: nowrap; cursor: pointer; user-select: none;
}
.trades tr:first-child th:first-child { border-top-left-radius: 9px; }
.trades tr:first-child th:last-child { border-top-right-radius: 9px; }
.trades th:hover { color: #1d1d1f; }
.trades th .arw { opacity: .55; font-size: 9px; }
.trades td { padding: 9px 10px; border-bottom: 1px solid #f1f1f4; white-space: nowrap; vertical-align: middle; }
/* Phone-only cells (the card layout below uses them) */
.trades td.c-meta, .trades td.c-sub { display: none; }
.trades tbody tr.row:hover td { background: #fafafc; }
.trades tbody tr.row { cursor: pointer; }
.trades tr.row.win td.rcol { color: #0a7d34; }
.trades tr.row.loss td.rcol { color: #d1232a; }
.trades .chev { color: #6b6b70; font-size: 11px; display: inline-block; transition: transform .12s; }
.trades tr.row.open .chev { transform: rotate(90deg); }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; }
/* Side is not P/L, so it must not borrow the green/red pair, and the accent is
   reserved for focus/links — LONG vs SHORT is told apart by weight, not hue. */
.pill.long { background: #e9eaee; color: #1d1d1f; }
.pill.short { background: #f4f4f6; color: #55555c; }
.pill.tp { background: #e7f7ec; color: #0a7d34; }
.pill.sl { background: #fdecec; color: #d1232a; }
.pill.close { background: #f1f1f4; color: #55555c; }
.tk { font-weight: 650; }
.small { font-size: 11px; color: #6b6b70; }
.tag { display: inline-block; background: #f1f1f4; color: #55555c; border-radius: 5px;
  padding: 0 5px; font-size: 10.5px; margin-right: 3px; }
/* A chip in a history row can be dragged: the order is what the trader reads. */
.trades tr.row .c-tags .tag { cursor: grab; }
.trades tr.row .c-tags .tag.drag-tag { opacity: .45; cursor: grabbing; }
/* Deals thrown out of the history, seen through «Удалённые»: readable, not loud. */
.trades tr.row.hidden-row td { opacity: .5; }
.trades .del.restore { color: #1d4ed8; }
/* The list's own one-line answer to a drag: the card's status line is out of sight. */
.tag-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  background: rgba(28, 28, 32, .92); color: #fff; font-size: 12px; padding: 7px 12px;
  border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s;
  z-index: 60; }
.tag-toast.on { opacity: 1; transform: translate(-50%, 0); }
.tag-toast.bad { background: #c0303a; }
/* RR of a real deal needs the hand-written stop, so the column only exists on
   an account's history — a CSV backtest has no stop to divide by. */
.trades th.c-rr, .trades td.c-rr { width: 44px; text-align: right; }
html:not(.broker) .trades th.c-rr, html:not(.broker) .trades td.c-rr { display: none; }
/* The last row keeps the card's rounded bottom now that the table cannot use
   overflow:hidden (that would kill the sticky header). */
.trades tbody tr:last-child td:first-child { border-bottom-left-radius: 9px; }
.trades tbody tr:last-child td:last-child { border-bottom-right-radius: 9px; }
/* Was #c7c7cc — 1.68:1 on white, i.e. a nearly invisible control (one per row). */
.del { background: none; border: 0; color: #6b6b70; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.del:hover { background: #d1232a; color: #fff; }

/* Detail (unfolded) row */
tr.detail td { padding: 0; background: #fbfbfd; border-bottom: 1px solid #e6e6ea; }
.detail-inner { padding: 12px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, 1fr); gap: 12px; }
@media (max-width: 820px) { .detail-inner { grid-template-columns: 1fr; } }
.chart-box { background: #fff; border: 1px solid #e6e6ea; border-radius: 10px; overflow: hidden; }
.chart-toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid #f1f1f4; flex-wrap: wrap; }
.chart-note { font-size: 11px; color: #6b6b70; padding: 5px 8px; }
/* The review chart is the app in a frame: the card owns the height the user
   asked for (three quarters of the screen) and the frame owns the scrolling. */
.reviewbox { height: 75vh; height: 75dvh; min-height: 420px; background: #fff; }
.review-frame { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 820px) { .reviewbox { height: 75dvh; min-height: 320px; } }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; align-content: start; }
.info-grid .k { font-size: 11px; color: #6b6b70; }
.info-grid .v { font-size: 13px; font-weight: 600; }
.detail-side { display: flex; flex-direction: column; gap: 8px; }
.detail-side textarea {
  width: 100%; min-height: 68px; padding: 7px 9px; border: 1px solid #d5d5da; border-radius: 4px;
  font-size: 13px; resize: none; overflow: hidden; background: #fff;
}
.detail-side input[type=text] {
  width: 100%; height: 27px; padding: 0 9px; border: 1px solid #d5d5da; border-radius: 4px; background: #fff;
}
/* Tag editor: chips for what is already on the trade, one input for adding.
   The input is a plain text field with a datalist, so a new tag is typed and an
   existing one is picked from the browser's own suggestion popup. */
.tag-editor {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  min-height: 30px; padding: 3px 5px; border: 1px solid #d5d5da; border-radius: 4px; background: #fff;
  position: relative;
}
.tag-editor input[type=text] {
  flex: 1 1 90px; min-width: 70px; height: 22px; padding: 0 3px; border: 0; outline: none; background: transparent;
}
.tag-editor .tag-chip[draggable="true"] { cursor: grab; }
.tag-editor .tag-chip.drag-chip { opacity: .45; cursor: grabbing; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 3px; height: 21px; padding: 0 5px;
  border-radius: 4px; background: #f1f1f4; color: #444; font-size: 11px; white-space: nowrap;
}
.tag-chip button {
  border: 0; background: none; color: #6b6b70; cursor: pointer; padding: 0; font-size: 12px; line-height: 1;
}
.tag-chip button:hover { color: #d1232a; }
.detail-side .lbl { font-size: 11px; color: #6b6b70; }
/* Two small tools next to the note's heading: record, rewrite, and an arrow that
   flips between the two versions once a rewrite has happened. */
.lbl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.note-tools { display: inline-flex; align-items: center; gap: 3px; }
.mini { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 1px solid #e2e2e6; border-radius: 5px; background: #fff; color: #5a5a60; cursor: pointer; line-height: 0; }
.mini:hover { background: #f2f2f5; color: #111; }
.mini:disabled { opacity: .45; cursor: default; }
.mini[hidden] { display: none; }
.mini svg { display: block; }
.mini.rec { border-color: #d1232a; background: #fdeceb; color: #d1232a; animation: noteRec 1.1s ease-in-out infinite; }
@keyframes noteRec { 50% { background: #f7d3d1; } }
.note-status { margin-top: 4px; font-size: 11px; color: #6b6b70; min-height: 13px; }
.note-status.bad { color: #d1232a; }
.note-status[hidden] { display: none; }
.detail-actions { display: flex; align-items: center; gap: 8px; }
.btn { height: 27px; padding: 0 12px; border-radius: 4px; border: 1px solid #d5d5da; background: #fff; cursor: pointer; }
.btn:hover { background: #f0f0f3; }
.btn.primary { background: #111; border-color: #111; color: #fff; }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: #d1232a; border-color: #f0c6c8; }
.btn.danger:hover { background: #d1232a; color: #fff; }
.saved { font-size: 11px; color: #0a7d34; }


/* Custom autocomplete. The native datalist popup is browser chrome and did not
   open reliably inside the unfolded table row, so strategy and tag suggestions
   are ordinary page elements now. */
.combo { position: relative; }
.combo-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 80;
  max-height: 220px; overflow: auto; padding: 4px;
  background: #fff; border: 1px solid #d5d5da; border-radius: 7px;
  box-shadow: 0 8px 24px rgba(17,17,19,.14);
}
.combo-menu[hidden] { display: none; }
.combo-opt {
  display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: 5px;
  background: none; color: #1d1d1f; text-align: left; font-size: 12px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-opt:hover, .combo-opt.active { background: #f0f0f3; }
.combo-empty { padding: 7px 8px; color: #6b6b70; font-size: 11px; }
.tag-editor .combo-menu { top: calc(100% + 4px); }

/* Custom date calendar for the trades filters (page-owned, not native chrome). */
.cr-datepicker {
  position: fixed; z-index: 100001; padding: 8px; background: #fff;
  border: 1px solid #d5d5da; border-radius: 9px;
  box-shadow: 0 12px 34px rgba(17,17,19,.18); font-size: 12px; color: #1d1d1f;
}
.cr-datepicker[hidden] { display: none; }
.cr-dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.cr-dp-title { font-weight: 650; font-size: 13px; }
.cr-dp-nav {
  width: 26px; height: 24px; border: 0; border-radius: 5px; background: none;
  color: #55555c; font-size: 18px; line-height: 1; cursor: pointer;
}
.cr-dp-nav:hover { background: #f0f0f3; color: #1d1d1f; }
.cr-dp-week, .cr-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cr-dp-week span { padding: 3px 0; text-align: center; color: #6b6b70; font-size: 10px; }
.cr-dp-empty { min-height: 28px; }
.cr-dp-day {
  height: 28px; border: 1px solid transparent; border-radius: 5px; background: none;
  color: #1d1d1f; font: inherit; cursor: pointer;
}
.cr-dp-day:hover { background: #f0f0f3; }
.cr-dp-day.today { border-color: #1d4ed8; }
.cr-dp-day.bt { box-shadow: inset 0 0 0 1px #0a7d34; }
.cr-dp-day.sel { background: #111; border-color: #111; color: #fff; }
.cr-dp-actions { display: flex; gap: 6px; margin-top: 8px; padding-top: 7px; border-top: 1px solid #eee; }
.cr-dp-short {
  flex: 1; height: 27px; border: 1px solid #d5d5da; border-radius: 5px;
  background: #fff; color: #1d1d1f; font-size: 11px; cursor: pointer;
}
.cr-dp-short:hover { background: #f0f0f3; }
.cr-dp-short:disabled { opacity: .45; cursor: default; }

/* ── Sticky summary bar ──────────────────────────────────────────────── */
.summary {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  border-top: 1px solid #e3e3e6; font-size: 12px; color: #55555c;
}
.summary b { color: #1d1d1f; font-weight: 650; }

.empty { padding: 60px 16px; text-align: center; color: #6b6b70; }
.loading { padding: 40px 16px; text-align: center; color: #6b6b70; }


/* ── In-page confirmation dialog ─────────────────────────────────────── */
.cr-modal {
  position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(17,17,19,.42); backdrop-filter: blur(2px);
}
.cr-modal[hidden] { display: none; }
.cr-modal-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid #e3e3e6;
  border-radius: 12px; box-shadow: 0 18px 60px rgba(17,17,19,.24); padding: 18px;
}
.cr-modal-card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.cr-modal-card p { margin: 0; color: #55555c; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.cr-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.cr-modal-actions button { min-width: 84px; }
@media (max-width: 700px) {
  .cr-modal { align-items: flex-end; padding: 10px; }
  .cr-modal-card { padding: 16px; }
  .cr-modal-actions button { flex: 1; }
}

/* ── Mobile: the table becomes cards ─────────────────────────────────── */
@media (max-width: 700px) {
  .tmm-header, .filters, .kpis, .table-wrap { padding-left: 10px; padding-right: 10px; }
  .filters { position: static; }
  table.trades { border: 0; background: none; display: block; }
  .trades thead { display: none; }
  .trades tbody { display: block; }
  .trades tr.row {
    display: grid; grid-template-columns: 14px 1fr auto 24px; grid-template-areas:
      'chev ticker r del'
      'chev meta   meta meta'
      'chev sub    sub sub';
    gap: 3px 8px; background: #fff; border: 1px solid #e6e6ea; border-radius: 10px;
    padding: 9px 10px; margin-bottom: 8px; position: relative;
  }
  .trades tr.row td { display: none; border: 0; padding: 0; }
  .trades tr.row td.c-chev { display: block; grid-area: chev; align-self: center; }
  .trades tr.row td.c-ticker { display: block; grid-area: ticker; font-size: 14px; }
  .trades tr.row td.c-r { display: block; grid-area: r; text-align: right; font-weight: 700; font-size: 14px; }
  .trades tr.row td.c-meta { display: block; grid-area: meta; white-space: normal; }
  .trades tr.row td.c-sub { display: block; grid-area: sub; white-space: normal; }
  .trades tr.row td.c-del { display: block; grid-area: del; align-self: center; text-align: right; }
  .trades tr.row td.c-del .del { padding: 0; font-size: 12px; }
  .trades tr.detail { display: block; }
  .trades tr.detail td { display: block; border: 0; }
  .detail-inner { padding: 10px 0 14px; }
  .chart-toolbar { gap: 4px; }
  .summary { gap: 10px; font-size: 11px; padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); }
}

/* ── Dashboard ───────────────────────────────────────────────────────── */
.dash { max-width: 1180px; margin: 0 auto; padding: 12px 16px 40px; }
.panel {
  background: #fff; border: 1px solid #e6e6ea; border-radius: 10px; padding: 10px 12px 12px;
}
.panel h2 { font-size: 13px; font-weight: 650; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.panel h2 .small { font-weight: 400; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.equity-panel { margin-top: 12px; }
.eq-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; font-size: 12px; color: #6b6b70; }
.eq-controls label { display: flex; align-items: center; gap: 4px; }
.eq-controls select, .eq-controls input[type=number] {
  height: 27px; padding: 0 6px; border: 1px solid #d5d5da; border-radius: 4px; background: #fff;
}
.eq-controls input[type=number] { width: 92px; }
.eq-wrap { position: relative; }
.eq-tip { position: absolute; pointer-events: none; background: rgba(28,28,32,.94); color: #fff;
  font-size: 11px; line-height: 1.45; padding: 6px 8px; border-radius: 7px; white-space: nowrap;
  transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s; z-index: 5; }
.eq-tip.on { opacity: 1; }
.eq-wrap canvas { display: block; width: 100%; }
.breakdown { display: flex; flex-direction: column; gap: 5px; }
.bd-row { display: grid; grid-template-columns: 112px 1fr 58px; gap: 8px; align-items: center; font-size: 12px; }
.bd-bar { height: 14px; background: #f1f1f4; border-radius: 4px; overflow: hidden; position: relative; }
/* The bar encodes the same sign as the number beside it, so it uses the P/L pair
   instead of a third palette: black → green → red would have been three colours
   meaning two things. */
.bd-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #8fc7a3; }
.bd-bar i.neg { background: #eeb2b5; }
.bd-row .n { text-align: right; color: #55555c; font-variant-numeric: tabular-nums; }
.bd-row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-grid { display: grid; grid-template-columns: 44px repeat(12, 1fr); gap: 3px; font-size: 10.5px; }
.month-grid .cell { border-radius: 3px; padding: 3px 0; text-align: center; background: #f7f7f8; color: #6b6b70; }
.month-grid .head { background: none; color: #6b6b70; }
@media (max-width: 700px) {
  .dash { padding: 10px 10px 30px; }
  .grid2 { grid-template-columns: 1fr; }
  .kpis { padding-left: 0; padding-right: 0; grid-template-columns: repeat(2, 1fr); }
  .bd-row { grid-template-columns: 96px 1fr 52px; }
}

/* ── Password gate (shared with index.html via js/lock.js) ───────────── */
#lockGate {
  position: fixed; inset: 0; z-index: 99999; background: #fff;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
html.unlocked #lockGate { display: none; }
#lockGate form { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 8px; }
#lockGate h1, #lockGate .lock-title { font-size: 18px; font-weight: 600; margin: 0; }
#lockGate .lock-hint { font-size: 13px; color: #55555c; margin-bottom: 4px; }
#lockGate label { font-size: 12px; color: #55555c; }
#lockGate input {
  height: 40px; padding: 0 10px; border: 1px solid #999; border-radius: 4px;
  font-size: 16px;   /* 16px keeps iOS Safari from zooming the page on focus */
}
#lockGate button {
  height: 40px; margin-top: 2px; border: 1px solid #000; background: #000; color: #fff;
  border-radius: 4px; font-size: 14px; cursor: pointer;
}
#lockGate button:active { opacity: .85; }
#lockErr { font-size: 12px; color: #c0231f; }
#lockErr[hidden] { display: none; }

/* ── The tag menu: one name, changed across the journal ─────────────────── */
#tagMenu {
  position: fixed; z-index: 300000; display: flex; flex-direction: column; gap: 2px;
  padding: 4px; min-width: 168px;
  background: #fff; border-radius: 8px;
  box-shadow: 0 0 0 1px #ccc, 0 8px 24px rgba(0, 0, 0, .16);
  font: 12px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#tagMenu[hidden] { display: none !important; }
#tagMenu > button {
  border: 0; background: none; text-align: left; cursor: pointer;
  padding: 6px 10px; border-radius: 6px; font: inherit; color: #111;
}
#tagMenu > button:hover { background: #f1f3f5; }
#tagMenu > button[data-tm="delete"] { color: #c02626; }
#tagMenu .tm-note { padding: 2px 10px 6px; max-width: 240px; color: #777; line-height: 1.35; }
#tagMenu .tm-note[hidden] { display: none; }
#tagMenu .tm-rename { display: flex; gap: 4px; padding: 4px 4px 2px; }
#tagMenu .tm-rename[hidden] { display: none; }
#tagMenu .tm-rename input {
  flex: 1 1 auto; min-width: 120px; padding: 4px 6px;
  border: 1px solid #ccc; border-radius: 6px; font: inherit;
}
#tagMenu .tm-rename button {
  border: 1px solid #ccc; background: #fff; border-radius: 6px; padding: 4px 8px;
  font: inherit; cursor: pointer;
}
