:root {
  color-scheme: light;
  --page: #d8d9d6;
  --panel: #ffffff;
  --soft: #f3f4f5;
  --line: #747474;
  --line-soft: #d8dadd;
  --text: #111111;
  --muted: #62676d;
  --blue: #244ac7;
  --up: #087c2e;
  --down: #c51b1b;
  --market-up: #007aff;
  --market-down: #d32f2f;
  --price-up: #007aff;
  --price-down: #d32f2f;
  --fill-up: #129dcc;
  --fill-down: #e24642;
}

* { box-sizing: border-box; }

html {
  font-family: "Noto Sans JP";
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  letter-spacing: -0.02em;
  background-color: var(--page);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .11) .7px, transparent .8px),
    linear-gradient(135deg, rgba(255,255,255,.3), rgba(255,255,255,0) 42%);
  background-size: 4px 4px, 100% 100%;
}

button, input { font: inherit; }
/* Keep Western numerals crisp while Japanese copy uses Noto Sans JP. */
.card-change, .card-price, .point-change, .chart-percent-label,
.chart-extreme text, .axis-labels, .stream-stats, .card-symbol,
.test-source, .market-status, .vote-counts, .numeric {
  font-family: "Inter";
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
button { color: inherit; }

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 58px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: transparent;
}

.site-name { color: #202020; font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 900; letter-spacing: .075em; }
.site-name-link { text-decoration: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.account-status { color: var(--muted); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.settings-link { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #344149; text-decoration: none; -webkit-tap-highlight-color: transparent; }
/* The supplied JPEG has a white square around its centered 75%-diameter circle. */
.settings-link img { display: block; width: 44px; height: 44px; object-fit: contain; clip-path: circle(37.5% at center); transition: transform 120ms ease, filter 120ms ease; }
.settings-link:hover img { transform: scale(1.05); }
.settings-link:active img { transform: translateY(2px) scale(.9); filter: brightness(.88); }
.settings-link:focus-visible { outline: 2px solid #5e3a96; outline-offset: 1px; }
.test-link { padding: 7px 9px; color: var(--muted); border: 1px solid #888; background: rgba(255,255,255,.7); font-size: .75rem; font-weight: 800; text-decoration: none; }
.test-link:hover { color: var(--blue); border-color: var(--blue); }
body:has(#detailPage) .topbar { justify-content: flex-end; }

.eyebrow, .section-kicker {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .13em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: clamp(1.2rem, 3vw, 1.65rem); letter-spacing: -.025em; }

main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 64px; }
.sentiment, .market-section, .diagnostics { padding-top: 22px; }
.market-section { margin-top: 34px; border-top: 1px solid #aaa; }
.market-section:first-child { margin-top: 0; padding-top: 8px; border-top: 0; }
.market-section > .section-heading { justify-content: flex-end; margin-bottom: 9px; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 16px; }
.section-note { max-width: 380px; margin-bottom: 2px; color: var(--muted); font-size: .82rem; line-height: 1.55; text-align: right; }
.section-heading.compact { align-items: center; }

.dashboard-tabs { position: relative; display: flex; align-items: end; gap: 4px; min-height: 47px; margin: 18px 0 10px; padding: 0 4px 5px; overflow-x: auto; border-bottom: 1px solid #9a9a9a; scrollbar-width: none; user-select: none; -webkit-user-select: none; }
.dashboard-tabs::-webkit-scrollbar { display: none; }
.dashboard-tab-overflow { position: sticky; z-index: 3; align-self: center; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; min-width: 28px; height: 36px; padding: 0; border: 0; background: transparent; color: #36434c; cursor: pointer; font-size: 2.1rem; font-weight: 700; line-height: 1; transform: translateY(-2px); }
.dashboard-tab-overflow-left { left: 0; margin-right: 2px; }
.dashboard-tab-overflow-right { right: 0; margin-left: 2px; }
.dashboard-tab-overflow[hidden] { display: none; }
.dashboard-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; min-width: 72px; height: 36px; padding: 5px 12px; border: 1px solid #a9abad; border-radius: 0; background: #e5e6e7; color: #62676d; cursor: pointer; font-size: .88rem; font-weight: 800; white-space: nowrap; touch-action: manipulation; }
.dashboard-tab.active { position: relative; z-index: 1; background: #fff; color: #111; border-color: #1d3442; }
.dashboard-tab-add { min-width: 40px; padding: 3px 10px; color: var(--market-up); background: #dff2ff; font-size: 1.2rem; }
.dashboard-tab:focus-visible { outline: 2px solid var(--market-up); outline-offset: 1px; }
.dashboard-tab-menu { position: absolute; z-index: 20; display: flex; gap: 6px; padding: 8px; border: 1px solid #8b8e91; background: #fff; box-shadow: 2px 3px 8px rgba(0,0,0,.22); transform: translateY(2px); }
.dashboard-tab-menu button { padding: 10px 16px; min-width: 88px; border: 1px solid #c1c3c5; background: #f7f7f7; color: #222; cursor: pointer; font-size: .9rem; font-weight: 700; white-space: nowrap; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dashboard-tab-menu button:hover, .dashboard-tab-menu button:focus-visible { border-color: var(--market-up); color: var(--market-up); }

.sentiment-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sentiment-card { padding: 13px; border: 1px solid #9b9b9b; border-radius: 0; background: #fff; }
.sentiment-card h3 { margin: 0 0 10px; font-size: .95rem; }
.vote-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vote-button { min-height: 38px; border: 1px solid #969696; border-radius: 0; background: linear-gradient(#fff, #ececec); cursor: pointer; font-size: .82rem; font-weight: 800; box-shadow: 1px 2px 3px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.95); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.vote-button:hover { background: linear-gradient(#fff, #e3e8f3); border-color: var(--blue); transform: translateY(-1px); box-shadow: 1px 3px 5px rgba(0,0,0,.24), inset 0 1px 0 #fff; }
.vote-button:active { transform: translateY(1px); box-shadow: inset 1px 2px 3px rgba(0,0,0,.18); }
.vote-button.buy { color: var(--market-up); }
.vote-button.sell { color: var(--market-down); }
.vote-button:disabled { opacity: .55; cursor: not-allowed; }
.sentiment-bar { height: 7px; overflow: hidden; display: flex; margin-top: 11px; background: #ddd; }
.sentiment-bar span:first-child { background: var(--market-up); }
.sentiment-bar span:last-child { background: var(--market-down); }
.vote-counts { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: .72rem; }

.stream-stats { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.latest-news {
  width: min(760px, 100%);
  margin: 20px auto 0;
  padding: 22px 0 18px;
  border-top: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
}
.guide-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(760px, 100%);
  min-height: 66px;
  margin: 52px auto 0;
  padding: 14px 54px;
  border: 1px solid #173d57;
  background: #173d57;
  color: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,.2);
  font-size: clamp(1rem, 2.3vw, 1.18rem);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.guide-cta:hover { background: #234f6b; transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0,0,0,.18); }
.guide-cta:active { transform: translateY(2px) scale(.995); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.guide-cta:focus-visible { outline: 3px solid #5e3a96; outline-offset: 3px; }
.guide-cta-arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.35em; font-weight: 500; }
.latest-news-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.latest-news-heading h2 { font-size: 1rem; }
.latest-news-heading span { color: var(--muted); font-size: .72rem; }
.latest-news-list {
  max-height: 7rem;
  overflow-y: auto;
  background: rgba(255,255,255,.22);
  border-right: 1px solid #c2c2c2;
  scrollbar-color: #8f969b #e7e9ea;
  scrollbar-width: auto;
}
.latest-news-list::-webkit-scrollbar { width: 10px; }
.latest-news-list::-webkit-scrollbar-track { background: #e7e9ea; }
.latest-news-list::-webkit-scrollbar-thumb {
  background: #8f969b;
  border: 2px solid #e7e9ea;
  border-radius: 8px;
}
.latest-news-list::-webkit-scrollbar-thumb:hover { background: #687178; }
.latest-news-empty { margin: 0; padding: 14px 16px; color: var(--muted); font-size: .8rem; }
.latest-news-item { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 18px; padding: 5px 2px; align-items: baseline; }
.latest-news-item time { color: var(--muted); font-family: "Inter"; font-size: .74rem; white-space: nowrap; }
.latest-news-item h3 { margin: 0; font-size: .86rem; font-weight: 500; }
.latest-news-item p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
@media (max-width: 640px) {
  .guide-cta { min-height: 60px; margin-top: 34px; padding-inline: 42px; }
  .guide-cta-arrow { right: 14px; }
  .latest-news { margin-top: 16px; padding-top: 18px; }
  .latest-news-item { gap: 10px; font-size: .78rem; }
  .latest-news-item time { font-size: .68rem; }
  .latest-news-item h3 { font-size: .8rem; }
}
.site-footer {
  width: min(760px, 100%);
  margin: 20px auto 0;
  padding: 0 0 28px;
  color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.site-footer a { color: inherit; font-size: .75rem; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--text); text-decoration: underline; }
@media (max-width: 640px) {
  .site-footer { margin-top: 16px; padding-bottom: 22px; }
  .site-footer nav { gap: 6px 14px; }
  .site-footer a { font-size: .7rem; }
}
.info-page { width: min(620px, 100%); margin: 0 auto; padding: 34px 0 42px; }
.about-card { border: 1px solid #6c7478; background: rgba(255,255,255,.82); padding: 28px 24px 24px; text-align: center; box-shadow: 2px 3px 0 rgba(68,68,68,.22); }
.about-avatar { display: block; width: 136px; height: 136px; margin: 0 auto 16px; object-fit: cover; border-radius: 50%; }
.about-card h1 { margin: 0; font-size: clamp(1.35rem, 4vw, 1.9rem); }
.about-lead { margin: 9px 0 22px; color: var(--muted); line-height: 1.65; font-size: .9rem; }
.about-links { display: grid; gap: 10px; }
.about-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 7px 14px; border: 1px solid #6c7478; border-radius: 8px; background: #fff; color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 650; text-align: left; }
.about-link:hover, .about-link:focus-visible { border-color: var(--blue); background: #f7fbff; }
.about-icon { display: inline-grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 4px; color: #fff; font-size: .9rem; }
.about-icon.youtube { background: #f00; }
.about-icon.blog { background: #1616d9; color: #f33; font-size: .75rem; }
.about-icon.blog-image { object-fit: cover; }
.about-icon.xmark { background: #111; font-size: 1.1rem; }
.contact-card { max-width: 640px; margin: 0 auto; }
.contact-card h1 { margin: 0; font-size: clamp(1.5rem, 5vw, 2rem); }
.contact-form-link { display: block; margin: 24px auto 12px; max-width: 420px; padding: 16px 20px; border: 1px solid #6c7478; border-radius: 8px; background: #fff; color: var(--text); text-decoration: none; font-weight: 700; }
.contact-form-link:hover, .contact-form-link:focus-visible { border-color: var(--blue); background: #f7fbff; }
.contact-note { margin: 14px 0 0; color: var(--muted); font-size: .78rem; }
.info-back { display: block; margin: 22px auto 0; width: fit-content; color: var(--muted); font-size: .85rem; text-decoration: none; }
.info-back:hover, .info-back:focus-visible { color: var(--text); text-decoration: underline; }

.not-found-main { min-height: min(68vh, 680px); display: grid; place-items: center; padding-top: 0; }
.not-found-card { width: min(100%, 620px); padding: clamp(28px, 6vw, 64px) 24px; text-align: center; background: rgba(255,255,255,.94); border: 2px solid #666; box-shadow: 6px 6px 0 rgba(0,0,0,.16); }
.not-found-code { margin: 0 0 10px; color: var(--blue); font-size: clamp(4rem, 16vw, 7rem); line-height: .95; font-weight: 900; }
.not-found-card h1 { font-size: clamp(1.4rem, 5vw, 2rem); }
.not-found-message { margin: 18px 0 26px; color: var(--muted); line-height: 1.8; }
.not-found-home { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 10px 24px; border: 2px solid #243d4b; background: #fff; color: var(--text); font-weight: 800; text-decoration: none; box-shadow: 3px 3px 0 rgba(0,0,0,.15); }
.not-found-home:hover { color: var(--blue); border-color: var(--blue); }
.not-found-home:active { transform: translateY(2px); box-shadow: 1px 1px 0 rgba(0,0,0,.15); }
.privacy-main { max-width: 760px; }
.privacy-card { text-align: left; }
.privacy-card h1 { text-align: center; }
.privacy-meta { margin: 6px 0 26px; color: var(--muted); text-align: center; font-size: .82rem; }
.privacy-card h2 { margin: 24px 0 8px; padding-top: 12px; border-top: 1px solid #c9ced0; font-size: 1.05rem; }
.privacy-card p { margin: 0; color: #3f474b; font-size: .9rem; line-height: 1.8; }
@media (max-width: 640px) { .info-page { padding: 22px 0 32px; } .about-card { padding: 22px 16px 18px; } .about-avatar { width: 112px; height: 112px; } }

/* How-to guide */
.guide-main { width: min(780px, 100%); }
.guide-card { padding: 0; overflow: hidden; text-align: left; }
.guide-hero { padding: 34px 30px 28px; text-align: center; background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(235,244,250,.94)); border-bottom: 1px solid #aeb4b8; }
.guide-kicker { margin: 0 0 7px; color: var(--market-up); font-family: "Inter"; font-size: .7rem; font-weight: 800; letter-spacing: .18em; }
.guide-hero h1 { font-size: clamp(1.55rem, 5vw, 2.15rem); }
.guide-hero p:last-child { max-width: 520px; margin: 12px auto 0; color: var(--muted); font-size: .9rem; line-height: 1.75; }
.guide-section { padding: 34px 30px; border-bottom: 1px solid #c4c8ca; scroll-margin-top: 12px; }
.guide-copy { display: grid; grid-template-columns: 45px 1fr; gap: 13px; align-items: start; margin-bottom: 20px; }
.guide-number { display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid #293b46; background: #fff; color: var(--market-up); font-family: "Inter"; font-size: .9rem; font-weight: 850; box-shadow: 2px 2px 0 rgba(36,74,199,.16); }
.guide-copy h2 { margin: 1px 0 6px; font-size: 1.15rem; }
.guide-copy p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.75; }
.guide-shot { position: relative; margin: 0; overflow: hidden; border: 1px solid #6f767a; background: #eef0f1; box-shadow: 3px 4px 0 rgba(68,68,68,.2); }
.guide-shot img { display: block; width: 100%; height: auto; }
.guide-shot figcaption { padding: 10px 13px; background: #fff; color: #4f585e; font-size: .73rem; line-height: 1.6; }
.guide-shot figcaption span { display: inline-grid; place-items: center; width: 19px; height: 19px; margin: 0 5px 0 8px; border-radius: 50%; background: var(--market-up); color: #fff; font-family: "Inter"; font-weight: 800; }
.guide-shot figcaption span:first-child { margin-left: 0; }
.guide-shot-wide { max-width: 540px; margin-inline: auto; }
.guide-shot-full { width: 100%; margin-inline: auto; }
.guide-visual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.guide-shot-add img, .guide-shot-detail img { height: auto; object-fit: contain; object-position: center top; }
.guide-detail-demo { display: grid; gap: 8px; padding: 12px; border: 1px solid #6f767a; background: rgba(255,255,255,.72); box-shadow: 3px 4px 0 rgba(68,68,68,.2); }
.guide-mini-chart { position: relative; min-height: 86px; overflow: hidden; padding: 8px; border: 1px solid #999; background: #fff; }
.guide-mini-chart strong { position: relative; z-index: 1; font-size: .82rem; }
.guide-mini-line { position: absolute; inset: 44px 12px auto; height: 3px; background: linear-gradient(160deg, transparent 0 12%, #244ac7 13% 21%, transparent 22% 27%, #244ac7 28% 55%, transparent 56% 63%, #244ac7 64% 100%); transform: skewY(-5deg); }
.guide-detail-demo button { min-height: 37px; border: 1px solid #777; background: linear-gradient(#fff,#ececec); font-size: .76rem; font-weight: 800; pointer-events: none; }
.guide-detail-demo button.dark { background: #222; color: #fff; }
.guide-detail-demo button.danger { color: var(--market-down); }
.guide-short-steps { display: grid; gap: 7px; margin: 18px 0 0; padding: 0; list-style: none; }
.guide-short-steps li { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: baseline; padding: 9px 11px; background: rgba(255,255,255,.66); border-left: 3px solid #aab3b8; }
.guide-short-steps b { font-size: .78rem; }
.guide-short-steps span { color: var(--muted); font-size: .78rem; line-height: 1.55; }
.guide-shot-drag { max-width: 540px; margin-inline: auto; }
.guide-drag-arrow { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 7px 13px; border: 1px solid #49555c; background: rgba(255,255,255,.94); font-size: .76rem; font-weight: 800; box-shadow: 2px 3px 5px rgba(0,0,0,.18); }
.guide-drag-arrow span { padding: 0 7px; color: var(--market-up); }
.guide-note { margin: 13px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.6; }
.guide-tabs-demo { padding: 18px 14px 14px; border: 1px solid #6f767a; background: rgba(255,255,255,.76); box-shadow: 3px 4px 0 rgba(68,68,68,.2); }
.guide-tab-row { display: flex; gap: 4px; overflow: hidden; padding-bottom: 5px; border-bottom: 1px solid #999; }
.guide-tab-row span { flex: 1 0 62px; padding: 9px 8px; border: 1px solid #a9abad; background: #e5e6e7; color: #62676d; font-size: .77rem; font-weight: 800; text-align: center; white-space: nowrap; }
.guide-tab-row span.active { border-color: #1d3442; background: #fff; color: #111; }
.guide-tab-row span.plus { flex: 0 0 42px; background: #dff2ff; color: var(--market-up); font-size: 1rem; }
.guide-tab-menu-demo { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 14px auto 0; }
.guide-tab-menu-demo b { margin-right: 4px; color: var(--muted); font-size: .72rem; }
.guide-tab-menu-demo span { padding: 8px 12px; border: 1px solid #a9abad; background: #fff; font-size: .72rem; font-weight: 700; }
.guide-swipe { margin-top: 15px; color: #414b51; font-size: .78rem; font-weight: 700; text-align: center; }
.guide-swipe span { padding: 0 12px; color: var(--market-up); font-size: 1.2rem; }
.guide-tips { display: grid; gap: 7px; margin: 16px 0 0; padding: 0; list-style: none; }
.guide-tips li { position: relative; padding-left: 18px; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.guide-tips li::before { content: "\2713"; position: absolute; left: 0; color: var(--market-up); font-weight: 900; }
.guide-data-note { margin: 28px 30px 30px; padding: 16px 17px; border: 1px solid #9ba3a8; background: #f7f8f8; }
.guide-data-note strong { display: block; margin-bottom: 5px; font-size: .84rem; }
.guide-data-note p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.7; }
@media (max-width: 640px) {
  .guide-hero { padding: 27px 17px 23px; }
  .guide-hero p:last-child { font-size: .83rem; }
  .guide-section { padding: 27px 14px; }
  .guide-copy { grid-template-columns: 39px 1fr; gap: 10px; }
  .guide-number { width: 39px; height: 39px; font-size: .78rem; }
  .guide-copy h2 { font-size: 1rem; }
  .guide-copy p { font-size: .79rem; }
  .guide-visual-grid { grid-template-columns: 1fr; }
  .guide-shot-add img, .guide-shot-detail img { max-height: 380px; object-fit: contain; background: #d8d9d6; }
  .guide-short-steps li { grid-template-columns: 50px 1fr; }
  .guide-tab-menu-demo { flex-wrap: wrap; }
  .guide-data-note { margin: 23px 14px 25px; }
}

.market-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.market-grid { contain: layout style; }
.market-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1.12 / 1;
  overflow: hidden;
  border: 1px solid #666;
  border-radius: 0;
  background: var(--panel);
  box-shadow:
    2px 3px 0 rgba(68, 68, 68, .42),
    4px 6px 9px rgba(0, 0, 0, .2),
    inset 0 1px 0 rgba(255,255,255,.95);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.market-card * { -webkit-user-select: none; user-select: none; }

.market-grid:not(.detail-grid) .market-card[role="link"] {
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.market-grid:not(.detail-grid) .market-card[role="link"]:hover,
.market-grid:not(.detail-grid) .market-card[role="link"]:focus-visible {
  z-index: 1;
  outline: none;
  border-color: #1d4fb8;
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 rgba(36, 74, 199, .28), 5px 9px 14px rgba(0, 0, 0, .22);
}

.test-grid .market-card[role="link"] {
  touch-action: pan-y;
}
.test-grid.layout-dragging .market-card { transition: none; }
.test-grid.layout-dragging { touch-action: none; }
.test-grid .market-card.layout-drag-source { display: none; }
.layout-drop-placeholder {
  width: 100%;
  aspect-ratio: 1.12 / 1.06;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 3px dashed var(--market-up);
  background: rgba(0, 122, 255, .09);
  color: var(--market-up);
  font-size: .78rem;
  font-weight: 900;
  text-align: center;
  animation: placeholderPulse .8s ease-in-out infinite alternate;
}
.layout-drop-placeholder::before { content: "+"; font-size: 2rem; line-height: 1; }
.layout-drop-placeholder::after { content: "ここに挿入"; }
.layout-drag-ghost { position: fixed; z-index: 100; margin: 0; pointer-events: none; opacity: .88; transform: translate(-50%, -50%) rotate(1.5deg) scale(.92); box-shadow: 5px 8px 20px rgba(0,0,0,.3); }
@keyframes placeholderPulse { to { background: rgba(0, 122, 255, .18); } }

.card-content {
  height: 100%;
  padding: 0 8px 7px;
  display: grid;
  grid-template-rows: auto auto minmax(70px, 1fr) auto auto;
}
.market-grid:not(.detail-grid) .card-content {
  grid-template-rows: auto auto minmax(70px, 1fr) auto;
}

.card-titlebar {
  margin: 0 -8px;
  min-height: 29px;
  padding: 5px 7px 4px;
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid #b2b2b2;
  background: linear-gradient(#ffffff 0%, #ededed 52%, #d2d2d2 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 #bbb;
  overflow: hidden;
}

.card-name { margin: 0; font-size: 1.05rem; line-height: 1.2; font-weight: 900; letter-spacing: -.015em; }
.card-titlebar .card-name { text-align: left; }
.market-name-note { font-size: .67em; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.card-symbol { min-width: 0; max-width: 48%; overflow: hidden; color: var(--muted); font-size: .67rem; font-weight: 700; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.card-change {
  padding: 4px 0 0;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: .025em;
  text-align: center;
  font-size: clamp(2rem, 3.8vw, 3rem);
  line-height: .98;
  font-weight: 900;
  font-family: "Inter";
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.change-sign { display: inline-block; font-family: "Inter"; font-weight: 800; transform: translateY(-.02em); }
.change-percent-mark { display: inline-block; margin-left: .035em; font-size: .58em; line-height: 1; vertical-align: .08em; letter-spacing: 0; }
.positive .card-change { color: var(--price-up); }
.negative .card-change { color: var(--price-down); }
.card-change-row {
  min-width: 0;
  margin-inline: -2px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.card-change-row .card-change { width: 100%; min-width: 0; flex: 0 0 100%; white-space: nowrap; }
.card-change-row .market-status { position: absolute; right: 0; bottom: 0; flex: 0 0 auto; margin-left: 0; font-size: .63rem; }

.chart-wrap {
  min-height: 0;
  position: relative;
  margin: 2px -2px 0;
  overflow: hidden;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #aaa;
  background: #fff;
}
.chart { width: 100%; height: calc(100% - 17px); overflow: visible; }
.chart-grid { stroke: #e2e2e2; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-percent-line { stroke: #72c9db; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-percent-label {
  fill: #26829a;
  font-size: 13px;
  font-family: "Inter";
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, .88);
  stroke-width: 2px;
  stroke-linejoin: round;
}
.chart-extreme text {
  font-size: 13px;
  font-family: "Inter";
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chart-extreme-high .chart-extreme-tag { fill: #dff2ff; }
.chart-extreme-high text { fill: #164f7a; }
.chart-extreme-low .chart-extreme-tag { fill: #ffe2e2; }
.chart-extreme-low text { fill: #8f2424; }
.chart-baseline { stroke: #e12121; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 1.65; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.chart-current-marker { position: absolute; z-index: 3; width: 10px; height: 10px; border: 2px solid #111; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #fff; transform: translate(-50%, -50%); pointer-events: none; }
.chart-current-marker::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: #111; }
.chart-area { opacity: 1; }
.axis-labels { position: absolute; inset: auto 3px 1px; z-index: 2; display: flex; justify-content: space-between; color: #656565; font-size: .62rem; font-variant-numeric: tabular-nums; pointer-events: none; }
.card-footer .card-timestamp { display: none; }

.card-quote { min-width: 0; display: flex; justify-content: center; align-items: baseline; gap: 7px; padding-top: 3px; white-space: nowrap; }
.card-price { min-width: 0; font-size: clamp(1.35rem, 2.55vw, 1.9rem); font-weight: 900; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.card-unit { margin-left: 3px; color: var(--muted); font-size: .65rem; letter-spacing: 0; }
.point-change { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: .76rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.positive .point-change { color: var(--price-up); }
.negative .point-change { color: var(--price-down); }
.card-footer { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 5px; color: var(--muted); font-size: .63rem; white-space: nowrap; }
.card-footer, .test-source { width: 100%; overflow: hidden; }
.card-footer > span:first-child, .test-source > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card-footer strong { color: var(--text); font-weight: 750; }
.card-footer .card-timestamp { justify-self: center; }
.market-status { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; letter-spacing: .035em; }
.market-status { flex: 0 0 auto; }
.market-status.live { color: #258842; }
.market-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 1px rgba(17, 124, 61, .16); animation: marketLivePulse 1.5s ease-in-out infinite; }
.market-status.closed { color: var(--muted); }
.market-status.delayed { color: #a66a00; }
@keyframes marketLivePulse { 50% { opacity: .28; transform: scale(.72); } }

.empty-chart { position: absolute; inset: 0 0 17px; z-index: 2; display: grid; place-items: center; color: var(--muted); font-size: .76rem; text-align: center; }
.empty-chart.history-unavailable { color: #8f2424; font-weight: 700; }
.skeleton { background: linear-gradient(110deg, #f0f1f2, #fafafa 40%, #f0f1f2); }

.test-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 13px 0 12px; color: var(--muted); font-size: .78rem; }
.test-heading strong { color: var(--text); font-size: 1rem; }
.test-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.test-grid .market-card,
.test-grid > .add-chart-card { width: 100%; aspect-ratio: 1.12 / 1.06; }
.initial-loading-card { width: 100%; aspect-ratio: 1.12 / 1.06; min-height: 150px; border: 1px solid #b5b7b9; background: linear-gradient(110deg, #f0f1f2, #fafafa 40%, #f0f1f2); }
.test-grid .market-card { content-visibility: auto; contain-intrinsic-size: auto 220px; }
.test-grid .card-content { grid-template-rows: auto auto minmax(70px, 1fr) auto auto auto; }
.test-source { display: flex; justify-content: space-between; gap: 8px; padding-top: 3px; color: var(--muted); font-size: .58rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-timestamp { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.add-chart-card {
  align-self: start;
  min-height: 0;
  aspect-ratio: 1.12 / 1.06;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1px dashed #6f747a;
  border-radius: 0;
  background: rgba(255,255,255,.42);
  box-shadow:
    2px 3px 0 rgba(68, 68, 68, .42),
    4px 6px 9px rgba(0, 0, 0, .2),
    inset 0 1px 0 rgba(255,255,255,.95);
  color: #40454b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .14s ease;
}
.add-chart-card:hover, .add-chart-card:focus-visible { outline: none; border-color: var(--blue); background: #fff; color: var(--blue); transform: translateY(-2px); }
.add-chart-icon { font-size: 2.2rem; line-height: .8; font-weight: 400; }
.chart-picker { width: min(680px, calc(100% - 28px)); max-height: min(680px, calc(100% - 28px)); padding: 0; border: 1px solid #52565a; border-radius: 0; box-shadow: 0 18px 58px rgba(0,0,0,.26); background: #fff; color: var(--text); }
.chart-picker::backdrop { background: rgba(25, 30, 36, .28); }
.chart-picker-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px 11px; border-bottom: 1px solid var(--line-soft); }
.chart-picker h2 { margin: 0; font-size: 1.1rem; }
.chart-picker > p { margin: 13px 17px 10px; color: var(--muted); font-size: .82rem; }
.picker-close { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; border: 1px solid #8a8e93; border-radius: 0; background: #fff; color: var(--text); font: 400 1.3rem/1 "Inter"; cursor: pointer; }
.picker-categories { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 17px 13px; border-bottom: 1px solid var(--line-soft); }
.picker-category { border: 1px solid #9ca0a4; border-radius: 0; background: #fff; color: #444; padding: 6px 9px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.picker-category.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.picker-search-toggle { width: 46px; min-height: 42px; padding: 0; font-size: 1.55rem; line-height: 1; }
.picker-search { width: min(100% - 34px, 560px); box-sizing: border-box; margin: 0 auto; padding: 10px 0 0; }
.picker-search input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #9ca0a4; border-radius: 0; font: inherit; font-size: .82rem; outline: none; }
.picker-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(34,102,221,.14); }
.picker-empty { grid-column: 1 / -1; margin: 4px 0; color: var(--muted); font-size: .82rem; }
.picker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 14px 17px 18px; }
.picker-symbol { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: baseline; padding: 11px; border: 1px solid #969a9e; border-radius: 0; background: #fff; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.picker-symbol span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.picker-symbol small { grid-column: 1; color: var(--muted); font-size: .68rem; }
.picker-symbol b { grid-column: 2; grid-row: 1 / span 2; color: var(--blue); font-size: .75rem; }
.picker-symbol:not(:disabled):hover, .picker-symbol:not(:disabled):focus-visible { outline: none; border-color: var(--blue); background: #f3f8ff; }
.picker-symbol:disabled { opacity: .48; cursor: default; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(210px, 1fr);
  gap: 26px;
  align-items: start;
  padding-top: 24px;
}
.detail-grid { display: block; }
.detail-grid .market-card { width: 100%; aspect-ratio: 1.45 / 1; }
.detail-grid .card-content { padding: 0 14px 10px; grid-template-rows: auto auto minmax(170px, 1fr) auto auto; }
.detail-grid .card-titlebar { margin: 0 -14px; min-height: 40px; padding: 7px 12px 6px; justify-content: space-between; }
.detail-grid .card-name { font-size: clamp(1.2rem, 3vw, 1.7rem); }
.detail-grid .card-symbol { font-size: .78rem; }
.detail-grid .card-change { padding-top: 7px; font-size: clamp(3.2rem, 8vw, 5rem); }
.detail-grid .card-price { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.detail-grid .point-change { font-size: .92rem; }
.detail-grid .card-footer { font-size: .76rem; }
.detail-grid .chart-percent-label,
.detail-grid .chart-extreme text { font-size: 11px; }
.detail-grid .axis-labels { font-size: .72rem; }
/* Hidden for the minimal detail view; remove this display rule to restore the survey. */
.detail-sentiment { display: none; padding-top: 18px; }
.detail-sentiment-grid { display: block; }
.detail-sentiment .sentiment-card { padding: 16px; }
.detail-sentiment .sentiment-card h3 { display: none; }
.detail-sentiment .vote-actions { display: flex; justify-content: space-between; gap: 0; }
.detail-sentiment .vote-button { width: auto; min-height: 46px; padding-inline: .65em; font-size: .95rem; }
.detail-sentiment .sentiment-bar { height: 10px; }
.detail-actions {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #858585;
  background: rgba(255, 255, 255, .9);
  box-shadow: 2px 3px 0 rgba(68, 68, 68, .3), 4px 7px 12px rgba(0, 0, 0, .16);
}
.detail-action {
  width: 100%;
  min-height: 62px;
  padding: 12px 20px;
  border: 1px solid #777;
  border-radius: 0;
  background: linear-gradient(#fff, #e7e7e7);
  box-shadow: 1px 2px 3px rgba(0,0,0,.2), inset 0 1px 0 #fff;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
}
.detail-action:not(:disabled):hover { border-color: var(--blue); background: #eef3ff; }
.detail-action.primary { background: #252525; color: #fff; border-color: #111; box-shadow: 1px 3px 5px rgba(0,0,0,.28); }
.detail-action.danger { color: var(--market-down); }
.detail-action:disabled { opacity: .46; cursor: not-allowed; box-shadow: none; }

.diagnostics { margin-top: 34px; padding-top: 18px; border-top: 1px solid #aaa; color: var(--muted); }
.diagnostics summary { color: var(--text); cursor: pointer; font-weight: 800; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 14px; overflow: hidden; border: 1px solid #999; border-radius: 0; background: #999; }
.diagnostic-grid div { padding: 11px; display: flex; flex-direction: column; gap: 5px; background: #fff; }
.diagnostic-grid span { font-size: .72rem; }
.diagnostic-grid strong { color: var(--text); font-size: .88rem; font-variant-numeric: tabular-nums; }
.diagnostics p { margin: 12px 0 0; max-width: 760px; font-size: .8rem; line-height: 1.65; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; max-width: calc(100% - 32px); padding: 10px 15px; border: 1px solid #555; border-radius: 0; background: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.2); opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .25s; font-size: .84rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Keep each chart close to its familiar size, then add a column on wider screens. */
@media (min-width: 1440px) {
  body:not(:has(#detailPage)) .topbar,
  body:not(:has(#detailPage)) main {
    width: min(1480px, calc(100% - 48px));
  }

  .market-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .test-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1720px) {
  body:not(:has(#detailPage)) .topbar,
  body:not(:has(#detailPage)) main {
    width: min(1840px, calc(100% - 56px));
  }

  .market-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .test-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@keyframes pulse { 50% { opacity: .4; } }
@media (max-width: 850px) {
  .sentiment-grid, .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagnostic-grid { grid-template-columns: repeat(2, 1fr); }
  .card-change { font-size: clamp(2.2rem, 8vw, 3.2rem); }
  .detail-layout { grid-template-columns: 1fr; gap: 18px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .card-change { font-size: clamp(3rem, 11vw, 4.5rem); }
  .detail-actions { position: static; }
  .test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .picker-list { grid-template-columns: 1fr; }
}

/* On small tablets, add a column only while every chart remains at least as
   wide as a chart in the two-column iPhone reference layout (~189 CSS px).
   auto-fill keeps incomplete final rows aligned instead of stretching one
   remaining chart across the full row. */
@media (min-width: 541px) and (max-width: 850px) {
  .market-grid:not(.detail-grid), .test-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  /* The old tablet rule scaled headline numerals from the whole viewport,
     making them too large when a third/fourth card column appeared. Keep
     small-card typography close to the iPhone treatment. */
  .card-change { font-size: clamp(1.65rem, 6vw, 2.3rem); }
  .card-price { font-size: clamp(1.05rem, 3.6vw, 1.42rem); }
  .card-name { font-size: .94rem; }
  .card-quote { justify-content: center; gap: 4px; overflow: hidden; }
  .point-change { flex: 0 1 auto; font-size: .54rem; text-align: left; }
  .card-footer { gap: 3px; font-size: .54rem; }
  .market-status { font-size: .5rem; letter-spacing: 0; }
  .market-status-dot { width: 5px; height: 5px; }
  .axis-labels { font-size: .55rem; }
  .chart-percent-label, .chart-extreme text { font-size: 10px; }
}

/* Keep public test-board column count monotonic as it grows into desktop. */
@media (min-width: 851px) and (max-width: 1439px) {
  .test-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .topbar { width: min(100% - 18px, 1180px); padding-top: 16px; align-items: center; }
  main { width: min(100% - 18px, 1180px); }
  h1 { font-size: 1.3rem; }
  .section-heading { display: block; }
  .section-note { margin-top: 9px; text-align: left; }
  .sentiment-grid, .market-grid { gap: 4px; }
  .sentiment-card { padding: 10px; }
  .market-card { aspect-ratio: 1.12 / 1; box-shadow: 1px 2px 0 rgba(68,68,68,.4), 3px 5px 7px rgba(0,0,0,.18); }
  .test-grid .market-card,
  .test-grid > .add-chart-card { aspect-ratio: .92 / 1; }
  .card-content { padding: 0 5px 5px; grid-template-rows: auto auto minmax(50px, 1fr) auto auto; }
  .card-titlebar { margin: 0 -5px; padding: 4px 5px; }
  .card-name { font-size: .94rem; }
  .market-name-note { font-size: .55em; }
  /* iOS Safari zooms focused inputs below 16px; keep the viewport steady. */
  .picker-search input { font-size: 16px; }
  .card-symbol { font-size: .58rem; }
  .card-change { font-size: clamp(1.65rem, 8.6vw, 2.3rem); letter-spacing: 0; }
  .card-quote { justify-content: center; gap: 4px; overflow: hidden; }
  .card-price { flex: 0 1 auto; font-size: clamp(1.05rem, 5.2vw, 1.42rem); }
  .point-change { flex: 0 1 auto; font-size: .54rem; text-align: left; }
  .card-footer { gap: 3px; font-size: .54rem; }
  .market-status { font-size: .5rem; letter-spacing: 0; }
  .market-status-dot { width: 5px; height: 5px; }
  .card-change-row .market-status { bottom: 0; font-size: .5rem; }
  .axis-labels { font-size: .55rem; }
  .chart-percent-label, .chart-extreme text { font-size: 10px; }
  .stream-stats { margin-top: 10px; }
  .test-heading { display: block; }
  .test-heading span { display: block; margin-top: 4px; }
  .test-grid .card-content { grid-template-rows: auto auto minmax(70px, 1fr) auto; }
  .detail-layout { padding-top: 14px; }
  .detail-grid .market-card { aspect-ratio: 1.12 / 1; }
  .detail-grid .card-content { padding: 0 7px 7px; grid-template-rows: auto auto minmax(90px, 1fr) auto auto; }
  .detail-grid .card-titlebar { margin: 0 -7px; min-height: 34px; padding: 5px 7px; }
  .detail-grid .card-name { font-size: 1.08rem; }
  .detail-grid .card-change { font-size: clamp(2.6rem, 16vw, 4rem); }
  .detail-grid .card-price { font-size: clamp(1.45rem, 8vw, 2rem); }
  .detail-sentiment .vote-button { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* The public dashboard title follows the tab strip's left edge and sits
   closer to it; other information pages keep their original spacing. */
body:has(#testPage) .topbar { min-height: 52px; padding: 4px 8px; }
body:has(#testPage) .dashboard-tabs { margin-top: 0; }
@media (max-width: 540px) {
    body:has(#testPage) .topbar { min-height: 52px; padding: 4px 8px; }
}

/* Settings: a single, readable column on a phone and paired choices on desktop. */
.settings-main { width: min(760px, calc(100% - 28px)); padding-top: 18px; }
.settings-main > h1 { margin: 0 0 18px; }
.settings-panel { margin-bottom: 18px; padding: clamp(16px, 3vw, 28px); border: 1px solid #777; background: #fff; box-shadow: 3px 4px 0 rgba(0,0,0,.14); }
.settings-panel-heading h2 { margin: 0 0 5px; font-size: 1.22rem; }
.settings-panel-heading p, .settings-hint { margin: 0 0 15px; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.palette-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.palette-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.palette-card { position: relative; display: grid; gap: 9px; padding: 14px; border: 2px solid #b5bdc2; background: #fff; cursor: pointer; }
.palette-card:hover { border-color: #536877; }
.palette-card.selected { border-color: #143d5b; background: #f5fbff; box-shadow: inset 0 0 0 1px #143d5b; }
.palette-card:focus-within { outline: 3px solid #2f75cc; outline-offset: 2px; }
.palette-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.palette-card-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; font-size: .86rem; }
.palette-check { display: none; color: #123e60; font-size: 1.1rem; }
.palette-card.selected .palette-check { display: inline; }
.palette-swatches { display: flex; flex-wrap: wrap; gap: 18px; font-size: .78rem; }
.palette-swatches > span { display: inline-flex; align-items: center; gap: 5px; }
.palette-swatches i { display: inline-block; width: 21px; height: 21px; border: 1px solid #555; }
.palette-preview { display: flex; gap: 15px; padding: 7px 9px; border: 1px solid #e2e5e6; background: #fafafa; font-family: "Inter"; font-size: .88rem; }
.account-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.account-tab { padding: 11px; border: 1px solid #9ca6ad; background: #edf0f2; cursor: pointer; font-weight: 800; }
.account-tab.active { border-color: #15364b; background: #fff; box-shadow: inset 0 -3px #15364b; }
.settings-caution { margin: 0 0 16px; color: #806b00; font-size: .78rem; font-weight: 700; }
.account-form { display: grid; gap: 10px; max-width: 430px; }
.account-form[hidden], #guestAccount[hidden], #memberAccount[hidden], .sync-choice[hidden] { display: none; }
.account-form > label:not(.delete-checkbox) { display: grid; gap: 5px; font-size: .8rem; font-weight: 700; }
.account-form input:not([type="checkbox"]) { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #51616c; background: #fff; font-size: 16px; }
.account-form input:focus { outline: 2px solid #2f75cc; outline-offset: 1px; }
.account-form .settings-hint { margin: -5px 0 1px; }
.settings-button { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-width: 160px; min-height: 42px; padding: 8px 18px; border: 1px solid #344650; border-radius: 0; background: #fff; color: #1e303c; cursor: pointer; font-size: .85rem; font-weight: 800; text-decoration: none; }
.settings-button:hover, .settings-button:focus-visible { background: #eef4f8; }
.settings-button.primary { background: #263640; color: #fff; }
.settings-button.primary:hover { background: #3d5867; }
.settings-button.danger { border-color: #b52d2d; color: #a82323; }
.settings-button.danger.solid { background: #b52d2d; color: #fff; }
.settings-button:disabled { opacity: .5; cursor: wait; }
.form-message { min-height: 1.3em; margin: 10px 0 0; color: #b52d2d; font-size: .8rem; font-weight: 700; }
.account-name { margin: 0 0 9px; }
.delete-entry { margin-top: 28px; padding-top: 18px; border-top: 1px solid #d5d8da; }
.delete-entry h3 { font-size: 1rem; }
.delete-entry p, .delete-confirm-panel > p { max-width: 570px; color: #495259; font-size: .86rem; line-height: 1.65; }
.sync-choice { padding: 15px; border: 1px solid #34576c; background: #f5faff; }
.sync-choice h3 { margin: 0 0 7px; }
.sync-choice p { font-size: .85rem; line-height: 1.6; }
.sync-choice-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.delete-checkbox { display: flex; align-items: start; gap: 9px; font-size: .83rem; line-height: 1.5; }
.delete-checkbox input { margin-top: 3px; }
@media (max-width: 540px) {
  .settings-main { width: min(100% - 18px, 760px); }
  .palette-options { grid-template-columns: 1fr; }
  .account-status { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
  .settings-link { flex: 0 0 44px; }
}
