/* 全モック共通: 配色・書体・上部バー・詳細・札・ボタン・フォーカス。
   題材は放送の「マルチビューア」。赤(--tally)は「いま」と「進行中」だけに使う。 */

:root {
  --paper: #EEF1F4;
  --panel: #FFFFFF;
  --ink: #161A22;
  --slate: #5B6575;
  --rule: #D3D9E1;
  --tally: #E0201B;
  --warn: #B4470F;
  --star: #F2B705;
  --star-edge: #8A6A00;

  --font-body: 'BIZ UDPGothic', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-display: 'Dela Gothic One', 'BIZ UDPGothic', 'Hiragino Kaku Gothic ProN', sans-serif;

  --radius: 8px;
  --bar-h: 52px;
}

/* 分類の色（放送のカラーバー）。data-cat を付けた要素の中で --cc(縁) --cb(面) が使える */
[data-cat='keynote'] { --cc: #1F4FD8; --cb: #E3EAFD; }
[data-cat='special'] { --cc: #B0288F; --cb: #F8E3F2; }
[data-cat='program'] { --cc: #1B8A3E; --cb: #DFF3E5; }
[data-cat='exhibitor'] { --cc: #0B7F99; --cb: #DDF2F7; }
[data-cat='workshop'] { --cc: #8A6A00; --cb: #FBF1CC; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* キーボードのフォーカスは必ず見える枠で示す */
:focus-visible { outline: 2px solid #1F4FD8; outline-offset: 2px; }
.tbar :focus-visible { outline-color: #fff; }

/* ---- タリーランプ(「いま」「進行中」) ---- */
.lamp {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tally);
  box-shadow: 0 0 0 3px rgba(224, 32, 27, 0.28);
  animation: lamp-glow 2.6s ease-in-out infinite;
}
.lamp-sm { width: 8px; height: 8px; }
@keyframes lamp-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(224, 32, 27, 0.3); }
  50% { box-shadow: 0 0 0 5px rgba(224, 32, 27, 0.1); }
}
@media (prefers-reduced-motion: reduce) {
  .lamp { animation: none; }
}

/* ---- ボタン・入力 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #F2F5F8; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover:not(:disabled) { background: #2B3342; }
.btn-ghost { border-color: var(--rule); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.field {
  min-height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--slate);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}
.field::placeholder { color: #6B7587; }

/* ---- 分類の札・進行中の札・受付・会場 ---- */
.cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 6px;
  border: 1.5px solid var(--cc);
  border-radius: 4px;
  background: var(--cb);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}
.cat-sym { color: var(--cc); }
.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px 0 7px;
  border: 1.5px solid var(--tally);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}
.seats {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--slate);
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}
.seats-full { background: var(--ink); border-color: var(--ink); color: #fff; }
.seats-few { border-width: 2px; }
.seats-walkin { border-style: dashed; }
.seats-open { border-color: var(--rule); font-weight: 400; }

.venue { display: inline-flex; align-items: center; min-width: 0; font-size: 13px; }
.sys-bar { flex: none; width: 6px; height: 1.2em; margin-right: 6px; border-radius: 1px; }
.sys-kaigi { background: #3C4655; }
.sys-hall { background: repeating-linear-gradient(135deg, #5B6575 0 2px, #D3D9E1 2px 4px); }
.sys-annex { background: repeating-linear-gradient(0deg, #5B6575 0 2px, #fff 2px 4px); box-shadow: inset 0 0 0 1px #5B6575; }
.sys-mark {
  flex: none;
  min-width: 18px;
  margin-right: 6px;
  border: 1px solid var(--slate);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.venue-name { min-width: 0; }
.sys-name { margin-left: 6px; font-size: 13px; color: var(--slate); }
.detail-meta .venue { display: inline-flex; vertical-align: middle; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 0 10px;
  border: 1px solid var(--slate);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  line-height: 22px;
}

/* ---- ★のボタン ---- */
.star-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}
.star-btn:hover { background: rgba(22, 26, 34, 0.06); }
.star-svg { width: 26px; height: 26px; fill: none; stroke: var(--slate); stroke-width: 1.7; stroke-linejoin: round; }
.star-btn[aria-pressed='true'] .star-svg { fill: var(--star); stroke: var(--star-edge); }
.star-compact { width: 32px; height: 32px; }
.star-compact .star-svg { width: 20px; height: 20px; }
.star-withtext {
  display: inline-flex;
  gap: 8px;
  width: auto;
  padding: 0 16px 0 10px;
  border: 1.5px solid var(--ink);
  background: var(--panel);
  font-size: 14px;
  font-weight: 700;
}
.star-withtext .star-svg { width: 24px; height: 24px; }

/* ---- 上部バー ---- */
.tbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--bar-h);
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
}
.tbar-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.tbar-event { font-size: 12px; color: #C9D1DC; white-space: nowrap; }
.tbar-fake {
  padding: 0 6px;
  border: 1px solid #7B8698;
  border-radius: 3px;
  color: #E3E8EF;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.tbar-mock { display: flex; align-items: center; gap: 8px; margin-right: auto; min-width: 0; }
.tbar-mockno {
  flex: none;
  padding: 0 6px;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font: 500 13px/20px var(--font-mono);
}
.tbar-mockname { font-family: var(--font-body); font-weight: 700; font-size: 15px; line-height: 1.3; letter-spacing: 0.02em; }

.tbar-days { display: flex; flex: none; }
.tbar-day {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  align-items: center;
  border: 1px solid #4A5365;
  background: transparent;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}
.tbar-day + .tbar-day { margin-left: -1px; }
.tbar-day:first-child { border-radius: 6px 0 0 6px; }
.tbar-day:last-child { border-radius: 0 6px 6px 0; }
.tbar-day:hover { background: #2B3342; }
.tbar-day[aria-pressed='true'] { background: #fff; border-color: #fff; color: var(--ink); font-weight: 700; position: relative; }
.tbar-day-d { font-family: var(--font-mono); font-weight: 500; font-size: 12px; }

.tbar-nowwrap, .tbar-swwrap { position: relative; flex: none; }
.tbar-nowbtn, .tbar-swbtn, .tbar-fav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #4A5365;
  border-radius: 6px;
  background: #232A36;
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.tbar-nowbtn:hover, .tbar-swbtn:hover, a.tbar-fav:hover { background: #343D4D; }
.tbar-swbtn { gap: 0; }
.tbar-swbtn span { white-space: nowrap; }
.tbar-nowtext { font-weight: 700; }
.tbar-nowtext .nw { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.tbar-star { color: var(--star); font-size: 16px; line-height: 1; }
.tbar-favn { font-family: var(--font-mono); font-weight: 500; font-size: 14px; }

.tbar-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  min-width: 300px;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 14px 34px -8px rgba(22, 26, 34, 0.45), 0 0 0 1px var(--rule);
}
.pop-title { margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.pop-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.pop-row label { font-size: 13px; color: var(--slate); }
.pop-note, .pop-hint { font-size: 12px; color: var(--slate); }
.now-time { width: 5.5em; text-align: center; }
.sw-list { min-width: 280px; margin: -6px; }
.tbar-pop-right { min-width: 0; padding: 8px; }
.sw-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.sw-item:hover { background: #EEF1F4; }
.sw-item[aria-current='page'] { background: #E3E8EF; font-weight: 700; }
.sw-no { flex: none; min-width: 34px; padding: 0 6px; border-radius: 3px; background: var(--ink); color: #fff; font: 500 12px/20px var(--font-mono); text-align: center; }
.sw-index .sw-no { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sw-error { padding: 8px 12px; font-size: 13px; color: var(--warn); }
.sw-error::before { content: '⚠ '; }

@media (max-width: 1100px) {
  .tbar-event { display: none; }
}
@media (max-width: 760px) {
  .tbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas: 'mock now fav sw' 'days days days days';
    gap: 6px 8px;
    padding: 8px 12px 10px;
  }
  .tbar-brand { display: none; }
  .tbar-mock { grid-area: mock; flex-direction: column; align-items: flex-start; gap: 1px; margin: 0; }
  .tbar-mockno { font-size: 12px; line-height: 16px; }
  .tbar-mockname { font-size: 13px; line-height: 1.25; }
  .tbar-days { grid-area: days; }
  .tbar-day { flex: 1; flex-direction: column; justify-content: center; gap: 0; padding: 4px 6px; line-height: 1.25; }
  .tbar-nowwrap { grid-area: now; position: static; }
  .tbar-fav { grid-area: fav; }
  .tbar-swwrap { grid-area: sw; position: static; }
  .tbar-nowbtn { padding: 0 8px; gap: 6px; font-size: 12px; white-space: normal; text-align: left; line-height: 1.2; min-height: 40px; }
  .tbar-swbtn { flex-direction: column; justify-content: center; gap: 0; padding: 0 8px; font-size: 12px; line-height: 1.25; min-height: 40px; }
  .tbar-fav { min-height: 40px; padding: 0 9px; gap: 4px; }
  .tbar-pop { left: 8px; right: 8px; top: 100%; margin-top: 6px; min-width: 0; }
}

/* ---- 詳細(dialog) ---- */
dialog.detail {
  width: min(660px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px -12px rgba(22, 26, 34, 0.55);
  overflow: hidden;
}
dialog.detail::backdrop { background: rgba(22, 26, 34, 0.58); }
.detail-box { display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 6px solid var(--cc);
  background: var(--cb);
}
.detail-code { font: 500 14px/1 var(--font-mono); }
.detail-x { margin-left: auto; min-height: 32px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 6px; background: #fff; font-size: 13px; font-weight: 700; }
.detail-main { flex: 1; overflow-y: auto; padding: 16px 20px 8px; }
.detail-title { margin-bottom: 14px; font-size: 20px; font-weight: 700; line-height: 1.45; }
.detail-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin-bottom: 14px; font-size: 14px; }
.detail-meta dt { color: var(--slate); font-size: 13px; }
.detail-h { margin: 18px 0 6px; font-size: 13px; color: var(--slate); letter-spacing: 0.04em; }
.detail-speakers li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.sp-org { color: var(--slate); }
.sp-role { padding: 0 7px; border-radius: 3px; background: #E3E8EF; font-size: 12px; line-height: 20px; }
.detail-desc { font-size: 14.5px; line-height: 1.85; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--rule); background: #F6F8FA; }
.detail-actions .btn:last-child { margin-left: auto; }
@media (max-width: 760px) {
  dialog.detail { width: calc(100vw - 16px); }
  .detail-title { font-size: 18px; }
  .detail-meta { grid-template-columns: 1fr; gap: 0; }
  .detail-meta dd { margin-bottom: 8px; }
  .detail-actions .btn:last-child { margin-left: 0; }
}

/* ---- 読み込みの失敗 ---- */
.load-error {
  max-width: 520px;
  margin: 48px auto;
  padding: 20px 22px;
  border: 1.5px solid var(--warn);
  border-radius: var(--radius);
  background: #fff;
}
.load-error p { margin-bottom: 12px; font-weight: 700; }
.load-error p::before { content: '⚠ '; color: var(--warn); }
