/* ============================================================
   SIGNAL PUB：デザイン
   - 先頭の色を変えると、サイト全体に反映されます
   - 配色は TDA-1BP コントロールサイトに合わせた暗色基調
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #0e1014;
  --panel: #171a21;
  --panel-2: #1d212b;
  --inset: #11141a;
  --line: #2a303d;
  --line-strong: #3a4254;
  --text: #e8ebf1;
  --muted: #9aa3b2;
  --accent: #37be78;          /* テーマカラー：サイリスの緑（暗い背景用に明るくしたもの。ボタン・強調） */
  --accent-rgb: 55, 190, 120; /* --accent と同じ色（半透明の塗りに使う） */
  --accent-hover: #54d492;
  --accent-ink: #04170d;      /* アクセント色の上に載せる文字 */
  --warn: #f2a93b;            /* 注意（メール未確認など） */
  --warn-rgb: 242, 169, 59;
  --info: #4cc3e0;            /* データの種類 IR のバッジ（EQ の緑と見分けるため） */
  --link: #8ab4ff;
  --ch-l: #5b9dff;            /* グラフ：L チャンネル */
  --ch-r: #ff7a9c;            /* グラフ：R チャンネル */
  --like: #ff5a7a;
  --danger: #ff5a5a;
  --ok: #3ecf8e;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --font: "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  --top-h: 60px;
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; }
html.hasDialog { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: anywhere;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.noscript {
  margin: 40px auto;
  max-width: 520px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

/* ---------- アイコン ---------- */

.icon { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 画面上部 ---------- */

.topBar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 16, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topBarInner {
  max-width: 1600px;
  margin: 0 auto;
  height: var(--top-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex: none;
}
.brand:hover { text-decoration: none; }

.brandMark { width: 32px; height: 32px; }
.brandMarkBg { fill: var(--accent); }
.brandMarkCurve {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brandName {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.brandPub { color: var(--accent); }

.searchBox { flex: 1; max-width: 460px; margin: 0 auto; }
.searchBox input {
  width: 100%;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--inset);
}
.searchBox input::placeholder { color: var(--muted); }
.searchBox input:focus { border-color: var(--accent); outline: none; }

.topActions { display: flex; align-items: center; gap: 10px; flex: none; }

.userMenuWrap { position: relative; }

.avatarButton {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: none;
  display: flex;
}
.avatarButton:hover, .avatarButton[aria-expanded="true"] { border-color: var(--accent); }

.userMenu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 210px;
  padding: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
}
.userMenuHead {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.userMenuNick { font-weight: 600; }
.userMenuId { color: var(--muted); font-size: 0.85rem; }
.userMenuItem {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-radius: 6px;
  background: none;
}
.userMenuItem:hover { background: var(--line); }

/* ---------- ボタン ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover { text-decoration: none; }

.buttonPrimary { background: var(--accent); color: var(--accent-ink); }
.buttonPrimary:hover:not(:disabled) { background: var(--accent-hover); }

.buttonGhost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.buttonGhost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.buttonDanger { background: transparent; color: var(--danger); border-color: var(--danger); }
.buttonDanger:hover:not(:disabled) { background: var(--danger); color: #fff; }

.linkButton {
  padding: 0;
  border: none;
  background: none;
  color: var(--link);
  text-decoration: underline;
  font-size: 0.9rem;
}

.iconButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
}
.iconButton:hover { background: var(--line); color: var(--text); }

/* ---------- お知らせ帯 ---------- */

.noticeBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  padding: 10px 20px;
  background: rgba(var(--warn-rgb), 0.12);
  border-bottom: 1px solid rgba(var(--warn-rgb), 0.35);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- ページ ---------- */

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  min-height: calc(100vh - var(--top-h) - 70px);
}

.feedHead { margin-bottom: 16px; }

.tagRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.tagRowLabel { color: var(--muted); font-size: 0.82rem; margin-right: 4px; }

.tagChip {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 0.85rem;
  max-width: 100%;
}
.tagChip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.hashtag { color: var(--link); }

.sortTabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.sortTabs:empty { display: none; }
.sortTab {
  padding: 8px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font-weight: 600;
}
.sortTab:hover { color: var(--text); }
.sortTab.active { color: var(--accent); border-bottom-color: var(--accent); }

.listTitle {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.listTitleSub { margin: 0; color: var(--muted); font-size: 0.85rem; }
.listTitleMain { margin: 0; font-size: 1.5rem; line-height: 1.3; }

/* ---------- プロフィール ---------- */

.profileCard {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.profileMain { flex: 1; min-width: 0; }
.profileNick { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.profileId { margin: 0; color: var(--muted); }
.profileBio { margin: 10px 0 0; white-space: pre-wrap; }
.profileStats { display: flex; gap: 24px; margin: 14px 0 0; }
.profileStat { display: flex; flex-direction: column-reverse; }
.profileStat dt { color: var(--muted); font-size: 0.8rem; }
.profileStat dd { margin: 0; font-size: 1.15rem; font-weight: 700; }

/* ---------- アイコン画像 ---------- */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--panel-2);
  display: inline-flex;
}
.avatarInitial {
  align-items: center;
  justify-content: center;
  background: hsl(var(--hue, 210) 45% 38%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  user-select: none;
}
.avatarL { width: 44px; height: 44px; }
.avatarL.avatarInitial { font-size: 1.15rem; }
.avatarXL { width: 88px; height: 88px; }
.avatarXL.avatarInitial { font-size: 2.2rem; }

/* ---------- タイムライン（画面の幅に合わせて列数が変わる） ---------- */

.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  align-items: start;
}

.tile {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.tile:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.tileGraph {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--inset);
  border-bottom: 1px solid var(--line);
}
.tileGraphSvg, .tileGraphSvg svg { display: block; width: 100%; height: 100%; }

.tileDevice {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
}
.tileDevice .icon { color: var(--accent); }
.tileDeviceName {
  max-width: calc(100% - 80px);
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(14, 16, 20, 0.78);
  border: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 左下（右下は目盛り「10k」があるので避ける）：データの種類と L/R の印 */
.tileBadges {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  gap: 5px;
  pointer-events: none;
}
.kindBadge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  color: var(--accent);
}
.kindBadge.kind-ir { background: rgba(76, 195, 224, 0.14); border-color: rgba(76, 195, 224, 0.5); color: var(--info); }
.lrBadge {
  display: inline-flex;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(14, 16, 20, 0.78);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}
.lrL { color: var(--ch-l); }
.lrR { color: var(--ch-r); }

.tileBody {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 14px 4px;
}
.tileUser {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text);
  font-weight: 600;
}
.tileNick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tileTime { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.tileText {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  min-height: 1.6em;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tileFoot {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 8px;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.statButton { border: none; border-radius: 999px; background: none; }
.statButton:hover { background: var(--line); color: var(--text); }

.likeButton.on { color: var(--like); }
.likeButton.on svg { fill: currentColor; }

.downloadButton {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.downloadButton:hover { border-color: var(--accent); color: var(--accent); }
.downloadButton.done { color: var(--ok); border-color: rgba(62, 207, 142, 0.5); }

/* ---------- グラフ ---------- */

.eqGraph .gGrid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.eqGraph .gZero { stroke: var(--muted); stroke-opacity: 0.55; stroke-width: 1; vector-effect: non-scaling-stroke; }
.eqGraph .gCurve {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.eqGraph .gCurveL { stroke: var(--ch-l); }
.eqGraph .gCurveR { stroke: var(--ch-r); }
.eqGraph .gFillTop { stop-color: var(--ch-l); stop-opacity: 0.4; }
.eqGraph .gFillMid { stop-color: var(--ch-l); stop-opacity: 0.03; }
.eqGraph .gLabel { fill: var(--muted); font-size: 10px; opacity: 0.85; }
.eqGraph .gAxis { fill: var(--muted); font-size: 12px; }
.eqGraph .gAxisY { text-anchor: end; dominant-baseline: middle; }
.eqGraph .gAxisX { text-anchor: middle; }
.eqGraph .gUnit { text-anchor: start; font-size: 11px; opacity: 0.8; }
.eqGraph .gUnitEnd { text-anchor: end; }
.eqGraph .gPoint { stroke: var(--inset); stroke-width: 2; }
.eqGraph .gPointL { fill: var(--ch-l); }
.eqGraph .gPointR { fill: var(--ch-r); }
.eqGraph .gCursor { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; }

.detailGraph {
  position: relative;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  touch-action: pan-y;
}
.detailGraph svg { display: block; width: 100%; height: auto; }

.graphTip {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

.graphLegend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}
.legendItem { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.legendLine { width: 20px; height: 3px; border-radius: 2px; }
.legendL { background: var(--ch-l); }
.legendR { background: var(--ch-r); }
.legendNote { margin-left: auto; }

/* ---------- 読み込み中・空の状態 ---------- */

.feedStatus { padding: 28px 0; }

.spinner {
  width: 30px;
  height: 30px;
  margin: 20px auto;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.emptyState {
  max-width: 460px;
  margin: 30px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.emptyTitle { margin: 0; font-size: 1.15rem; font-weight: 700; }
.emptyText { margin: 0; color: var(--muted); }
.emptyButtons { display: flex; gap: 10px; }

.siteFoot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  padding: 22px 20px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- お知らせ（画面下） ---------- */

.toasts {
  position: fixed;
  inset: auto auto 24px 50%;   /* ポップオーバーの既定の配置（画面中央）を打ち消す */
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
  transform: translateX(-50%);
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 520px);
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: var(--radius-s);
  background: #2b3140;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  animation: toastIn 0.25s ease-out;
}
.toast-error { border-color: var(--danger); background: #3a2226; }
.toast.leaving { opacity: 0; transition: opacity 0.3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- ダイアログ ---------- */

.dialog {
  width: min(94vw, 520px);
  max-height: min(92vh, 92dvh);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: rgba(5, 6, 8, 0.72); backdrop-filter: blur(3px); }

.dialogInner {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
}
.dialogHead { margin: 0 40px 16px 0; }
.dialogTitle { margin: 0 0 14px; font-size: 1.2rem; }
.dialogHead .dialogTitle { margin: 0; }

.dialogClose {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(23, 26, 33, 0.8);
}

/* ---------- フォーム ---------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.form.busy { opacity: 0.7; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fieldRow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fieldTop { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fieldLabel { font-weight: 600; font-size: 0.9rem; }
.fieldReq {
  margin-left: 7px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  font-size: 0.72rem;
}
.fieldCount { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.fieldCount.over { color: var(--danger); font-weight: 700; }

.field input, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-strong);
  background: var(--inset);
}
.field textarea { resize: vertical; min-height: 64px; line-height: 1.55; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field.hasError input, .field.hasError textarea { border-color: var(--danger); }

.fieldHint { margin: 0; color: var(--muted); font-size: 0.82rem; }
.fieldError, .formError { margin: 0; color: var(--danger); font-size: 0.88rem; font-weight: 600; }

.formButtons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.checkField { display: flex; align-items: flex-start; gap: 9px; font-size: 0.92rem; cursor: pointer; }
.checkField input { width: 17px; height: 17px; margin-top: 4px; accent-color: var(--accent); flex: none; }

.doneText { margin: 0 0 8px; }

/* ---------- ログイン・登録 ---------- */

.authTabs { display: flex; margin: 0 40px 18px 0; border-bottom: 1px solid var(--line); }
.authTab {
  flex: 1;
  padding: 10px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font-weight: 700;
}
.authTab.active { color: var(--accent); border-bottom-color: var(--accent); }

.authReason {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  font-size: 0.9rem;
}
.forgotLink { align-self: flex-start; }

/* ---------- 投稿の詳細 ---------- */

.postDialog { width: min(96vw, 1180px); }
.postDialog .dialogInner { padding: 0; display: flex; flex-direction: column; min-height: 0; }

.postLayout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  min-height: min(60vh, 520px);
}

.postMain { padding: 22px; min-width: 0; border-right: 1px solid var(--line); }
.postSide { padding: 22px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.postDeviceRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 40px 14px 0;
}
.postDevice { display: flex; align-items: center; gap: 12px; min-width: 0; }
.postDevice > .icon { width: 30px; height: 30px; color: var(--accent); }
.postDeviceMaker { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.3; }
.postDeviceModel { margin: 0; font-size: 1.3rem; line-height: 1.3; }
.productBadge {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.bandDetails { margin-top: 14px; }
.bandDetails summary { cursor: pointer; color: var(--link); font-size: 0.9rem; }
.bandTableWrap { margin-top: 10px; overflow-x: auto; }
.bandTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.bandTable th, .bandTable td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
.bandTable thead th { color: var(--muted); font-weight: 600; }
.bandTable tbody th { color: var(--muted); font-weight: 400; text-align: center; }
.bandTable thead th:first-child { text-align: center; }
.bandHeadL { color: var(--ch-l) !important; text-align: center !important; }
.bandHeadR { color: var(--ch-r) !important; text-align: center !important; }
.bandUp { color: #ffc46b; }
.bandDown { color: #7fc4ff; }
.bandRowOff td, .bandOff { color: var(--muted); opacity: 0.6; }
.bandNote { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; }

.postAuthor { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-right: 40px; }
.postAuthorLink { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--text); }
.postAuthorLink:hover { text-decoration: none; }
.postAuthorLink:hover .postAuthorNick { text-decoration: underline; }
.postAuthorText { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.postAuthorNick { font-weight: 700; }
.postAuthorId, .postTime { color: var(--muted); font-size: 0.84rem; }
.postTime { white-space: nowrap; }

.postBody { margin: 0; white-space: pre-wrap; }
.postTags { display: flex; flex-wrap: wrap; gap: 6px; }
.postTags:empty { display: none; }

.postActions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 -8px; }
.actionButton, .actionStat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.actionButton:hover { background: var(--line); color: var(--text); }
.actionButton .icon, .actionStat .icon { width: 1.3em; height: 1.3em; }
.actionDanger { margin-left: auto; }
.actionDanger:hover { color: var(--danger); }

.downloadWide { width: 100%; min-height: 46px; font-size: 1rem; }
.downloadWideCount {
  margin-left: 4px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(26, 18, 4, 0.16);
  font-size: 0.82rem;
}

.replyTitle {
  margin: 6px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}
.replyList { display: flex; flex-direction: column; gap: 14px; }
.replyEmpty { margin: 0; color: var(--muted); font-size: 0.9rem; }
.reply { display: flex; gap: 10px; }
.replyAvatar { flex: none; display: flex; align-self: flex-start; }
.replyMain { min-width: 0; flex: 1; }
.replyHead { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.replyNick { color: var(--text); font-weight: 700; font-size: 0.9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replyTime { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.replyDelete { margin-left: auto; width: 26px; height: 26px; opacity: 0.6; }
.replyDelete:hover { opacity: 1; color: var(--danger); }
.replyBody { margin: 0; white-space: pre-wrap; font-size: 0.93rem; }

.replyForm { gap: 8px; }
.replyLogin { display: flex; }

/* ---------- 新しい投稿 ---------- */

.composeDialog { width: min(94vw, 640px); }

.composeFrom {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: rgba(62, 207, 142, 0.1);
  border: 1px solid rgba(62, 207, 142, 0.4);
  font-size: 0.9rem;
}
.composeFrom .icon { color: var(--ok); }

.dropZone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--inset);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropZone:hover, .dropZone.dragging { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.06); }
.dropZone > .icon { width: 34px; height: 34px; color: var(--accent); }
.dropZone.hasFile { border-style: solid; padding: 12px 16px; }
.dropText { display: flex; flex-direction: column; min-width: 0; }
.dropSub { color: var(--muted); font-size: 0.82rem; }
input:focus-visible + .dropZone { outline: 2px solid var(--accent); outline-offset: 2px; }

.forcedTags { margin-top: -6px; }
.tagPreview { margin-top: -6px; line-height: 1.7; word-break: break-word; }
.tagPreviewLabel { color: var(--muted); }

/* ---------- 設定 ---------- */

.settingsDialog { width: min(94vw, 600px); }
.settings { display: flex; flex-direction: column; gap: 26px; }
.settingsSection { display: flex; flex-direction: column; gap: 14px; }
.settingsSection + .settingsSection { padding-top: 22px; border-top: 1px solid var(--line); }
.settingsTitle { margin: 0; font-size: 1.02rem; color: var(--accent); }
.settingsStatus { margin: 0; font-size: 0.92rem; }
.settingsPending { color: var(--muted); font-size: 0.85rem; }

.badgeOk, .badgeWarn {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badgeOk { background: rgba(62, 207, 142, 0.15); color: var(--ok); }
.badgeWarn { background: rgba(var(--warn-rgb), 0.16); color: var(--warn); }

.iconRow { display: flex; align-items: center; gap: 18px; }
.iconPreview { display: flex; }
.iconButtons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.iconButtons .fieldHint, .iconButtons .fieldError { flex-basis: 100%; }

/* ---------- 狭い画面 ---------- */

@media (max-width: 900px) {
  .postLayout { grid-template-columns: minmax(0, 1fr); }
  .postMain { border-right: none; border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .topBarInner { padding: 0 12px; gap: 10px; }
  .brandName { display: none; }
  .postButtonLabel { display: none; }
  .postButton { padding: 0; width: 38px; }
  .topActions .button { padding: 0 12px; }
  .page { padding: 14px 12px 32px; }
  /* キーワードは1行にして横へ送る（縦に何行も取って投稿が下がらないように） */
  .tagRow { flex-wrap: nowrap; overflow-x: auto; margin-right: -12px; padding: 0 12px 6px 0; scrollbar-width: none; }
  .tagRow::-webkit-scrollbar { display: none; }
  .tagRowLabel { display: none; }
  .tagChip { flex: none; }
  .feed { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: none; }
  .postDialog, .composeDialog, .settingsDialog { width: 100vw; }
  .authDialog { height: auto; width: 94vw; max-width: 94vw; border-radius: var(--radius); border: 1px solid var(--line-strong); }
  .dialogInner { padding: 18px 16px; }
  .postMain, .postSide { padding: 16px; }
  .fieldRow { grid-template-columns: 1fr; }
  .profileCard { flex-wrap: wrap; padding: 16px; gap: 14px; }
  .profileCard .avatarXL { width: 64px; height: 64px; }
  .profileEdit { width: 100%; }
  .listTitle { align-items: flex-start; flex-direction: column; }
  .legendNote { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.settingsMemberNo { margin-top: -10px; }

/* ---------- お知らせ ---------- */

.bellButton { position: relative; width: 38px; height: 38px; }
.bellButton .icon { width: 1.3em; height: 1.3em; }
.bellBadge {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--like);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.noticesDialog { width: min(94vw, 520px); }
.noticeList { display: flex; flex-direction: column; gap: 4px; margin: 0 -10px; }
.noticeItem {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-s);
  color: var(--text);
}
.noticeItem:hover { background: var(--panel-2); text-decoration: none; }
.noticeItem.unread { background: rgba(var(--accent-rgb), 0.08); }
.noticeText { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 0.9rem; }
.noticeExcerpt { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noticeTime { color: var(--muted); font-size: 0.78rem; }

/* ---------- 対応製品 ---------- */

.tileProducts {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tileProductsLabel {
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  font-size: 0.7rem;
}

.postProducts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 12px;
}
.postProductsLabel { color: var(--muted); font-size: 0.82rem; margin-right: 2px; }
.productChip {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}
a.productChip { gap: 5px; }
a.productChip:hover { background: rgba(var(--accent-rgb), 0.2); text-decoration: none; }
.productChip.productNoLink { cursor: default; }
.externalIcon { width: 0.85em; height: 0.85em; opacity: 0.8; }
.tileProductLink { color: var(--text); display: inline-flex; align-items: center; gap: 3px; }
.tileProductLink:hover { color: var(--accent); }
.tileProductLink.productNoLink { color: inherit; }

.composeKind { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 0.9rem; }
.compatNg { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.compatNg summary { cursor: pointer; }
.compatNg ul { margin: 6px 0 0; padding-left: 20px; }

/* サーバーからの複数行のエラー（製品ごとの理由）をそのまま改行して見せる */
.fieldError, .formError { white-space: pre-line; }

.irTable th { text-align: left !important; color: var(--muted); font-weight: 400; }
.irTable td { text-align: left; }

/* ---------- 利用規約・プライバシーポリシー（terms.html / privacy.html） ---------- */

.legal { max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; }
.legal h1 { font-size: 1.6rem; margin: 8px 0 18px; }
.legal h2 { font-size: 1.08rem; margin: 30px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.legal p, .legal li { color: var(--text); }
.legal ol, .legal ul { padding-left: 1.5em; }
.legal li { margin: 4px 0; }
.legalBack { font-size: 0.9rem; margin: 0; }
.legalDate { margin-top: 36px; color: var(--muted); text-align: right; }
.legalAgree { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }
