.nav-section {
  display: grid;
  gap: 3px;
  margin: 0 0 14px;
}

.nav-section + .nav-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.nav-section-label {
  margin: 0 10px 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.nav-section[data-role-section="admin"] .nav-section-label {
  color: var(--green);
}

.nav-section .nav-item {
  width: 100%;
}

.auth-feature-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.auth-feature-list span {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
}

.auth-feature-list span::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 800;
}

.notice.warning {
  border-color: rgba(243,184,78,.36);
  background: rgba(243,184,78,.06);
}

.notice.danger {
  border-color: rgba(255,124,124,.4);
  background: rgba(255,124,124,.06);
}

.form-error[data-message-type="success"] {
  color: var(--green);
}

.form-error[data-message-type="success"]::before {
  content: "✓ ";
}

@media (max-width: 760px) {
  .auth-feature-list { display: none; }
}

/* Shared site shell: pages without an account selector show their name in the same slot. */
.shell-context strong { display: block; font-size: 13px; font-weight: 700; }

/* Destructive actions (delete) look the same on every page. */
.button.danger { color: #ffc4c8; border-color: rgba(255,124,131,.38); background: rgba(255,124,131,.12); }
.button.danger:hover:not(:disabled) { border-color: rgba(255,124,131,.6); background: rgba(255,124,131,.2); }

/* Korean market convention: a gain is red, a loss is blue. */
.kr-up { color: #ff6b6b; }
.kr-down { color: #5b9dff; }
.holdings-accounts { flex-wrap: wrap; gap: 8px; }
.data-table th.numeric, .data-table td.numeric { text-align: right; font-variant-numeric: tabular-nums; }

/* One compact row on a composition's detail page: two choices and a save button. */
.composition-sharing-row { align-items: center; flex-wrap: wrap; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.composition-sharing-row label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.composition-sharing-row input[type="checkbox"] { width: auto; }

/* Histories that grow without bound: search, filters, pager and clean-up in one compact row. */
.history-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.history-toolbar input[type="search"] { flex: 1 1 260px; min-width: 200px; }
.history-toolbar select { width: auto; }
/* Every search row (text box, optional select, button) stays on one line; the text box takes the
   room left. One shared rule instead of one per page - pages kept missing it (2026-09-22). */
form.history-toolbar:not(.actions) { display: flex; flex-wrap: nowrap; }
form.history-toolbar:not(.actions) input:not([type="checkbox"]):not([type="radio"]) { flex: 1 1 auto; width: auto; min-width: 0; }
form.history-toolbar:not(.actions) select { flex: 0 0 auto; width: auto; max-width: 220px; }
form.history-toolbar:not(.actions) .button, form.history-toolbar:not(.actions) button { flex: 0 0 auto; white-space: nowrap; align-self: stretch; }
form.history-toolbar:not(.actions) { align-items: stretch; }
/* Phones: the text box gets its own line, the select and button share the next one. */
@media (max-width: 640px) {
  form.history-toolbar:not(.actions) { flex-wrap: wrap; }
  form.history-toolbar:not(.actions) input:not([type="checkbox"]):not([type="radio"]) { flex: 1 1 100%; }
  form.history-toolbar:not(.actions) select { flex: 1 1 0; max-width: none; min-width: 0; }
}
.history-spacer { flex: 1 1 auto; }
.history-pager { justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 14px; }

/* 시장 현황 (market-context-ui.js) and the dashboard's market widget. Charts are SVG attributes
   plus these classes: the CSP forbids inline style. */
.market-tabs { margin: 0 0 4px; flex-wrap: wrap; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.market-card { display: grid; gap: 4px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.market-card:hover { border-color: rgba(184,255,95,.4); }
.market-card strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.market-card-name { color: var(--muted); font-size: 12px; }
.market-card-change { min-height: 16px; font-size: 12px; font-variant-numeric: tabular-nums; }
.market-card small { color: var(--muted); font-size: 10px; }
.market-card.is-stale strong, .market-card.is-stale .market-card-change { opacity: .55; }
.spark { display: block; width: 100%; height: 34px; }
.spark polyline, .market-chart polyline { stroke: var(--muted); }
.spark-up polyline { stroke: #ff6b6b; }
.spark-down polyline { stroke: #5b9dff; }
.market-chart { display: block; width: 100%; height: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; }
.market-chart polyline { stroke: var(--green); }
.market-chart text { fill: var(--muted); font-size: 11px; }
.market-chart-range { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 11px; }
.market-detail-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.market-detail-head strong { font-size: 24px; }
.market-detail-head small { color: var(--muted); }
.market-flag { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; font-size: 12px; white-space: nowrap; }
.market-flag input { width: auto; min-height: 0; }
tr.is-retired td { opacity: .55; }
.indicator-grid .kr-up, .indicator-grid .kr-down { font-size: 11px; }
.market-card-live { cursor: default; }
.market-card-live:hover { border-color: var(--line); }
.market-card small.market-card-rule { color: var(--muted); opacity: .8; font-size: 10px; line-height: 1.35; }
.market-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin: 10px 0 0; }
.market-facts dt { color: var(--muted); font-size: 11px; }
.market-facts dd { margin: 2px 0 0; font-size: 13px; }
/* Search rows of 시장 현황 (news, disclosures, symbol news): one line - the box takes the room
   that is left, the select and the button keep their own width. Wraps only on a narrow screen. */
/* Article and disclosure titles are links: keep the site's text colour, underline on hover only. */
.list-row a, .data-table a { color: inherit; text-decoration: none; }
.list-row a:hover, .data-table a:hover { text-decoration: underline; }
/* 시장 종합 판단 */
.mood-panel .mood-verdicts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; padding: 0 2px; }
.mood-verdict { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.mood-verdict p { margin: 8px 0 0; font-size: 14px; line-height: 1.6; }
.mood-verdict.mood-good { border-color: rgba(86,217,152,.45); }
.mood-verdict.mood-caution { border-color: rgba(240,189,96,.55); background: rgba(240,189,96,.06); }
.mood-verdict.mood-danger { border-color: rgba(255,124,131,.6); background: rgba(255,124,131,.08); }
.mood-live { margin: 12px 2px 0; font-size: 13px; }
.mood-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 10px; margin-top: 12px; }
.mood-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.mood-card h3 { margin: 0; font-size: 15px; }
.mood-card h4 { margin: 14px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.mood-head { display: flex; justify-content: space-between; align-items: baseline; }
.mood-head strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.mood-good-text { color: #56d998; }
.mood-bad-text { color: #ff7c83; }
.mood-gauge { display: block; width: 100%; height: 34px; margin-top: 6px; }
.mood-track { fill: rgba(255,255,255,.06); }
.mood-good { fill: rgba(86,217,152,.35); }
.mood-bad { fill: rgba(255,124,131,.35); }
.mood-zero { stroke: var(--muted); stroke-width: 1.5; }
.mood-marker { fill: #f4f7f2; stroke: #11150f; stroke-width: 2; }
.mood-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.mood-say { margin: 10px 0 0; font-size: 14px; }
.reason-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.reason-list li { word-break: keep-all; overflow-wrap: anywhere; display: grid; grid-template-columns: 74px minmax(120px, 1.1fr) minmax(140px, 1.6fr) 52px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.025); font-size: 13px; }
.reason-list li span:nth-child(3) { color: var(--muted); font-size: 12px; }
.reason-list em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.reason-good .reason-mark, .reason-good em { color: #56d998; }
.reason-bad .reason-mark, .reason-bad em { color: #ff7c83; }
.reason-mark { font-size: 11px; white-space: nowrap; }
/* Phones: four fixed columns need 430 px; the description moves to its own line (2026-09-22). */
@media (max-width: 640px) {
  .reason-list li { grid-template-columns: 74px minmax(0, 1fr) 52px; }
  .reason-list li span:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .reason-list li em { grid-column: 3; grid-row: 1; }
}
.mood-note { margin: 12px 2px 0; font-size: 12px; line-height: 1.6; }
.mood-card p.muted { margin: 8px 0 0; font-size: 12px; }
.mood-card > small { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; }
.market-refreshed { margin: 8px 2px 0; font-size: 12px; }
.holding-spark { display: block; min-width: 100px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 11px; cursor: pointer; text-align: left; }
.holding-spark .spark { width: 100px; height: 30px; }
