* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family: var(--sb-font);
  font-size: var(--sb-fs-body);
  color: var(--sb-text);
  background-color: var(--sb-bg);
  background-image: radial-gradient(var(--sb-bg-dot) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--sb-accent);
  outline-offset: 2px;
}
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon--sm {
  width: 16px;
  height: 16px;
}
.muted {
  color: var(--sb-text-muted);
}
.meta {
  color: var(--sb-text-muted);
  font-size: var(--sb-fs-small);
}
.card {
  background: var(--sb-surface);
  border-radius: var(--sb-radius-card);
  box-shadow: var(--sb-shadow);
  padding: 24px;
}
.card__title {
  font-size: var(--sb-fs-title);
  font-weight: 600;
  margin: 0 0 12px;
}
.dashed {
  background: var(--sb-surface);
  border: 1.5px dashed var(--sb-border-dashed);
  border-radius: var(--sb-radius-panel);
  padding: 20px 24px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--sb-radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.btn--primary {
  background: var(--sb-accent);
  color: var(--sb-on-accent);
}
.btn--primary:hover {
  background: var(--sb-accent-hover);
}
.btn--primary:disabled {
  background: var(--sb-disabled-bg);
  cursor: default;
}
.btn--secondary {
  background: var(--sb-surface);
  border-color: var(--sb-border);
}
.btn--secondary:hover {
  border-color: var(--sb-border-hover);
}
.btn--sm {
  height: 38px;
  padding: 0 16px;
}
.btn--block {
  width: 100%;
  justify-content: center;
}
.iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sb-text-muted);
  flex: none;
}
.iconbtn:hover {
  background: var(--sb-surface-tint);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--sb-radius-chip);
  background: transparent;
  color: var(--sb-text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.chip:hover {
  background: var(--sb-surface-tint);
}
.chip[aria-pressed="true"],
.chip[aria-current="page"],
.chip[data-selected="true"],
.chip[aria-expanded="true"] {
  background: var(--sb-surface-tint);
  color: var(--sb-text);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--sb-radius-chip);
  background: var(--sb-surface-soft);
  color: var(--sb-accent-text);
  font-size: var(--sb-fs-small);
  font-weight: 500;
  white-space: nowrap;
}
.tag--plain {
  background: var(--sb-surface-tint);
  color: var(--sb-text-muted);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sb-accent);
}
.toggle {
  width: 40px;
  height: 22px;
  border-radius: var(--sb-radius-pill);
  background: var(--sb-toggle-off);
  position: relative;
  flex: none;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sb-surface);
  transition: left 0.15s;
}
.toggle[aria-checked="true"] {
  background: var(--sb-accent);
}
.toggle[aria-checked="true"]::after {
  left: 21px;
}
.field {
  display: block;
  margin-bottom: 16px;
}
.field__label {
  display: block;
  font-size: var(--sb-fs-small);
  color: var(--sb-text-muted);
  margin-bottom: 6px;
}
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-field);
  font: inherit;
  color: var(--sb-text);
  background: var(--sb-surface);
}
textarea.input {
  height: 88px;
  padding: 10px 14px;
  resize: none;
  line-height: 1.5;
}
.input::placeholder {
  color: var(--sb-text-placeholder);
}
.input--time {
  width: 96px;
  text-align: center;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: var(--sb-radius-row);
}
.row:hover {
  background: var(--sb-surface-tint);
}
.row__main {
  flex: 1;
  min-width: 0;
}
.row__label {
  font-weight: 500;
}
.skel {
  background: var(--sb-surface-tint);
  border-radius: var(--sb-radius-row);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.seg {
  display: flex;
  padding: 3px;
  background: var(--sb-surface-tint);
  border-radius: var(--sb-radius-pill);
  margin-bottom: 14px;
}
.seg button {
  flex: 1;
  height: 32px;
  border-radius: var(--sb-radius-pill);
  font-size: var(--sb-fs-secondary);
  font-weight: 500;
  color: var(--sb-text-muted);
}
.seg--sm {
  margin: 0;
  flex: none;
}
.seg--sm button {
  flex: none;
  height: 28px;
  padding: 0 10px;
  font-size: var(--sb-fs-small);
}
.seg button[aria-pressed="true"] {
  background: var(--sb-surface);
  color: var(--sb-text);
  box-shadow: var(--sb-shadow);
}

/* 管理画面 */
.admin {
  display: flex;
  min-height: 100%;
}
.sidebar {
  width: 235px;
  flex: none;
  background: var(--sb-surface);
  display: flex;
  flex-direction: column;
  padding: 16px 16px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--sb-fs-title);
  font-weight: 600;
  padding: 6px 6px 18px;
}
.section-label {
  color: var(--sb-text-muted);
  font-size: var(--sb-fs-small);
  margin: 14px 6px 6px;
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--sb-radius-row);
  width: 100%;
  text-align: left;
}
.nav__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav__item:hover,
.nav__item[aria-current="true"] {
  background: var(--sb-surface-tint);
}
.nav__item[aria-current="true"] {
  font-weight: 500;
}
.nav__item--sub {
  padding: 7px 8px 7px 30px;
  font-size: var(--sb-fs-secondary);
}
.nav__item .icon {
  color: var(--sb-text-muted);
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sb-surface-soft);
  border: 2px solid var(--sb-avatar-ring);
}
.main {
  flex: 1;
  min-width: 0;
  padding: 40px 32px 80px;
}
.column {
  width: 760px;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sb-gap-lg);
}
.column--narrow {
  width: 500px;
}
.work {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  align-items: flex-start;
}
.work .column {
  flex: 1 1 520px;
  width: auto;
  max-width: 760px;
  min-width: 0;
  margin: 0;
}
.iconbtn[aria-pressed="true"] {
  background: var(--sb-surface-tint);
  color: var(--sb-text);
}
.page-title {
  font-size: var(--sb-fs-heading);
  font-weight: 700;
  margin: 0;
}
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tabs {
  display: flex;
  gap: 4px;
  align-items: center;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* タイムテーブル */
.tt {
  display: grid;
  grid-template-columns: 52px repeat(var(--rooms), minmax(0, 1fr));
  column-gap: 8px;
}
.tt__room {
  text-align: left;
  font-weight: 600;
  font-size: var(--sb-fs-secondary);
  padding: 0 4px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tt__time {
  font-size: var(--sb-fs-small);
  color: var(--sb-text-muted);
  transform: translateY(-8px);
}
.tt__cell {
  border-top: 1px solid var(--sb-surface-tint);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
}
.tt__cell:hover,
.tt__cell:focus-visible {
  background: var(--sb-surface-soft);
  color: var(--sb-accent-text);
  border-radius: var(--sb-radius-row);
}
.tt__talk {
  margin: 2px 0;
  padding: 6px 10px;
  border-radius: var(--sb-radius-field);
  background: var(--sb-surface-tint);
  text-align: left;
  overflow: hidden;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid transparent;
}
.tt__talk:hover {
  border-color: var(--sb-border-hover);
}
.tt__talk[data-live="true"] {
  background: var(--sb-surface-soft);
  border-color: var(--sb-accent);
}
.tt__talk > * {
  flex: none;
}
.tt__talk-title {
  font-size: var(--sb-fs-secondary);
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: var(--clamp, 1);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 編集パネル */
.scrim {
  position: fixed;
  inset: 0;
  background: var(--sb-scrim);
  z-index: 30;
}
.panel {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--sb-surface);
  border-radius: var(--sb-radius-panel);
  box-shadow: var(--sb-shadow-panel);
  z-index: 31;
  display: flex;
  flex-direction: column;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 6px 24px;
}
.panel__body {
  flex: 1;
  overflow: auto;
  padding: 12px 24px;
}
.panel__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 24px 20px;
}
.panel__foot > .actions {
  margin-left: auto;
}

a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible {
  outline: 2px solid var(--sb-accent);
  outline-offset: 2px;
}
button:disabled {
  cursor: default;
}
.iconwrap {
  display: inline-flex;
  align-items: center;
}
.sidebar {
  overflow-y: auto;
}
.sidebar__foot {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.error {
  font-size: var(--sb-fs-secondary);
  color: var(--sb-text);
  overflow-wrap: anywhere;
}
.error[hidden] {
  display: none;
}
.date-fields,
.count-fields {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-fields input {
  width: 80px;
}
.date-fields input:first-child {
  width: 108px;
}
.count-fields > input {
  width: 90px;
}
input[type="number"] {
  appearance: textfield;
}
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
.loading-rows {
  display: grid;
  gap: 18px;
}
.loading-rows .skel {
  height: 44px;
}
.loading-grid {
  display: grid;
  grid-template-columns: 52px repeat(3, 1fr);
  gap: 8px;
}
.loading-grid .skel {
  height: var(--tt-row);
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  background: var(--sb-surface);
  border-radius: var(--sb-radius-pill);
  box-shadow: var(--sb-shadow);
  padding: 14px 24px;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login .column {
  width: 400px;
}
.tt-wrap {
  overflow-x: auto;
}
.tt {
  min-width: max(420px, calc(52px + var(--rooms) * 140px));
}
.tt__talk {
  min-height: 0;
}
.dialog {
  width: 420px;
  max-width: calc(100vw - 32px);
  border: 0;
  padding: 24px;
  border-radius: var(--sb-radius-card);
  background: var(--sb-surface);
  color: var(--sb-text);
  box-shadow: var(--sb-shadow-panel);
}
.dialog::backdrop {
  background: var(--sb-scrim);
}
.popover {
  background: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-panel);
  padding: 12px;
  margin-top: 8px;
}
.row__open {
  flex: 1;
  min-width: 0;
  display: block;
  text-align: left;
  padding: 4px 0;
}
.row__open .meta {
  display: block;
  margin-top: 4px;
}
.tabs {
  flex-wrap: wrap;
}
.panel .error {
  margin: 0;
  padding: 0 24px;
}
@media (max-width: 850px) {
  .head {
    align-items: flex-start;
    flex-direction: column;
  }
  .main {
    padding: 24px 16px 64px;
  }
}
@media (max-width: 620px) {
  .date-fields {
    flex-wrap: wrap;
  }
  .count-fields {
    flex-wrap: wrap;
  }
  .row {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skel {
    animation: none;
  }
}
.time-fields,
.room-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row--block {
  width: 100%;
  text-align: left;
}
.speaker {
  display: block;
  margin-top: 4px;
}
.settings {
  display: flex;
  flex-direction: column;
  gap: var(--sb-gap-lg);
}
.readonly {
  display: flex;
  align-items: center;
  background: var(--sb-surface-tint);
}
.logo-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.logo-field__image,
.logo-field__empty {
  box-sizing: border-box;
  width: 214px;
  height: 72px;
  padding: 10px;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-field);
  background: var(--sb-surface);
}
.logo-field__image {
  object-fit: contain;
}
.logo-field__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: var(--sb-border-dashed);
  color: var(--sb-text-muted);
  font-size: var(--sb-fs-small);
}

.preview {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  max-width: 100%;
}
.preview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-frame {
  overflow: hidden;
  border: 8px solid var(--sb-text);
  border-radius: 38px;
  background: var(--sb-bg);
  box-shadow: var(--sb-shadow-panel);
}
.preview-frame iframe {
  display: block;
  border: 0;
  transform-origin: top left;
}
.preview-frame--phone {
  width: 335.8px;
  height: 655.6px;
}
.preview-frame--phone iframe {
  width: 390px;
  height: 780px;
  transform: scale(0.82);
}
.preview-frame--pc {
  width: 532px;
  height: 352px;
  border-width: 6px;
  border-radius: var(--sb-radius-screen);
}
.preview-frame--pc iframe {
  width: 1040px;
  height: 680px;
  transform: scale(0.5);
}
.preview [hidden] {
  display: none;
}
.preview--hidden {
  display: none;
}
.dialog canvas {
  display: block;
  max-width: 100%;
  margin: auto;
}
.dialog .meta {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .preview {
    overflow: auto;
    align-items: flex-start;
  }
  .preview-frame {
    flex: none;
  }
}

.meter {
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
  height: 16px;
}
.meter i {
  width: 3px;
  height: 4px;
  background: var(--sb-accent);
  border-radius: 2px;
  transition: height 0.1s;
}
.console-lines {
  max-height: 480px;
  overflow: auto;
}
.console-line {
  text-align: left;
  line-height: 1.6;
}
.partial {
  color: var(--sb-text-muted);
  line-height: 1.6;
}
.mic-picker {
  position: relative;
}
.mic-picker .popover {
  z-index: 3;
}
.mic-picker [role="option"] {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
}
.mic-picker [aria-selected="true"] {
  background: var(--sb-surface-tint);
}

[hidden] {
  display: none !important;
}
.console-lines .pending {
  display: inline-block;
  width: 75%;
  height: 16px;
}
.console-languages {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.console-languages .chip[aria-pressed="true"] {
  background: var(--sb-surface-tint);
  color: var(--sb-text);
}
/* Cost estimates */
.column--costs {
  width: 900px;
  max-width: 100%;
}
.costs {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.cost-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.cost-tile {
  background: var(--sb-surface);
  border-radius: var(--sb-radius-panel);
  box-shadow: var(--sb-shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cost-value {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cost-budget {
  height: 8px;
  border-radius: var(--sb-radius-pill);
  background: var(--sb-surface-tint);
  overflow: hidden;
}
.cost-budget i {
  display: block;
  height: 100%;
  background: var(--sb-accent);
}
.cost-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}
.cost-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.cost-legend {
  display: flex;
  gap: 14px;
  font-size: var(--sb-fs-small);
  color: var(--sb-text-muted);
}
.cost-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}
.cost-series-1::before {
  background: var(--series-1);
}
.cost-series-2::before {
  background: var(--series-2);
}
.cost-chart {
  position: relative;
  margin-top: 16px;
}
.cost-chart svg {
  display: block;
  overflow: visible;
}
.cost-axis {
  font: 12px var(--sb-font);
  fill: var(--sb-text-muted);
}
.cost-label {
  font: 13px var(--sb-font);
  fill: var(--sb-text);
}
.cost-chart g:focus {
  outline: 2px solid var(--sb-accent);
}
.cost-tip {
  position: absolute;
  top: 0;
  right: auto;
  z-index: 2;
  pointer-events: none;
  background: var(--sb-surface);
  border-radius: var(--sb-radius-field);
  box-shadow: var(--sb-shadow-panel);
  padding: 10px 12px;
  font-size: var(--sb-fs-small);
}
.cost-table-scroll {
  overflow-x: auto;
  margin-top: 16px;
}
.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--sb-fs-secondary);
}
.cost-table th {
  text-align: left;
  font-weight: 500;
  color: var(--sb-text-muted);
  padding: 8px;
  white-space: nowrap;
}
.cost-table td {
  padding: 10px 8px;
  border-top: 1px solid var(--sb-surface-tint);
  font-variant-numeric: tabular-nums;
}
.console-cost {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  flex-wrap: wrap;
  margin-top: 16px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1000px) {
  .cost-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cost-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 550px) {
  .cost-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}
.cost-talks {
  position: relative;
}
.cost-talks > .cost-chart-head {
  margin-top: 0;
}
.cost-talks > .cost-prices {
  position: absolute;
  top: 70px;
  right: 16px;
  max-width: min(740px, calc(100% - 32px));
  max-height: 420px;
  overflow: auto;
  background: var(--sb-surface);
  padding: 18px 20px;
  border-radius: var(--sb-radius-panel);
  box-shadow: var(--sb-shadow-panel);
  z-index: 3;
}

.cost-talks > .cost-table-scroll > .cost-table td {
  white-space: nowrap;
}
.cost-talks > .cost-table-scroll > .cost-table th:first-child,
.cost-talks > .cost-table-scroll > .cost-table td:first-child {
  width: 100%;
  min-width: 12em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cost-talks > .cost-table-scroll > .cost-table th:nth-child(n+3):nth-child(-n+7),
.cost-talks > .cost-table-scroll > .cost-table td:nth-child(n+3):nth-child(-n+7) { text-align: right; }
.console-cost > b { font-weight: 700; }
.console-cost > span { margin-left: auto; text-align: right; }

.ops-graphs {
  display: grid;
  gap: 24px;
}
.sidebar__foot > .nav__item {
  flex-basis: 100%;
}

.ops-unavailable { white-space: nowrap; font-family: var(--sb-font); font-size: var(--sb-fs-small); font-weight: normal; }
