:root {
  --page-bg: #eef7ff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --ink: #19324a;
  --muted: #65819b;
  --line: rgba(62, 120, 177, 0.16);
  --primary: #176cb8;
  --primary-strong: #0f3f72;
  --secondary: #12a7c4;
  --accent-soft: rgba(18, 167, 196, 0.12);
  --shadow: 0 18px 40px rgba(22, 69, 120, 0.14);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --font-display: "Noto Sans JP", "Segoe UI", sans-serif;
  --font-body: "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(18, 167, 196, 0.18), transparent 26%),
    radial-gradient(circle at bottom right, rgba(23, 108, 184, 0.16), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, var(--page-bg) 100%);
}

button,
input,
textarea {
  font: inherit;
}

.dashboard-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 18px auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar,
.main-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.brand-block,
.sidebar-card,
.hero-panel,
.panel-surface,
.toolbar-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand-block {
  padding: 24px;
  background:
    radial-gradient(circle at right top, rgba(255, 255, 255, 0.2), transparent 40%),
    linear-gradient(135deg, rgba(23, 108, 184, 0.96), rgba(13, 52, 90, 0.95));
  color: #f4fbff;
}

.brand-kicker,
.hero-kicker,
.card-label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-block h1,
.hero-panel h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  line-height: 1.1;
}

.brand-block h1 {
  font-size: clamp(30px, 3vw, 38px);
}

.brand-break {
  display: block;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .brand-break {
    display: none;
  }
}

.brand-copy,
.hero-panel p,
.sidebar-card p,
.panel-heading p {
  margin: 0;
  line-height: 1.6;
  color: inherit;
}

.sidebar-card,
.hero-panel,
.toolbar-panel,
.panel-surface {
  padding: 20px;
}

.resident-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.resident-avatar {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 700;
}

.resident-row strong,
.panel-heading h3,
.preview-header h4 {
  display: block;
  margin: 0 0 4px;
  font-family: var(--font-display);
}

.resident-row p {
  color: var(--muted);
}

.mini-stats,
.shift-grid,
.composer-grid,
.hero-badges,
.tab-row,
.filter-row,
.chip-row,
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-stats div {
  flex: 1 1 80px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

.mini-stats span,
.summary-list,
.summary-list li,
.panel-heading p,
.preview-card p,
.sidebar-card textarea::placeholder,
.composer-panel textarea::placeholder,
.composer-panel input::placeholder {
  color: var(--muted);
}

.mini-stats span {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.mini-stats strong {
  font-size: 18px;
}

.shift-chip,
.view-tab,
.filter-pill,
.category-chip,
.sidebar-action,
.primary-action,
.secondary-action,
.mini-copy {
  border: 0;
  cursor: pointer;
  transition: 140ms ease;
}

.shift-chip,
.view-tab,
.filter-pill,
.category-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(23, 108, 184, 0.08);
  color: var(--primary);
}

.shift-chip.active,
.view-tab.active,
.filter-pill.active,
.category-chip.active {
  background: var(--primary);
  color: #f6fbff;
  box-shadow: 0 10px 22px rgba(23, 108, 184, 0.22);
}

.summary-list {
  margin: 14px 0 0;
  padding-left: 18px;
}

.summary-list li + li {
  margin-top: 8px;
}

.sidebar-card textarea,
.composer-panel textarea,
.composer-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  padding: 14px 15px;
}

.sidebar-card textarea,
.composer-panel textarea {
  min-height: 112px;
  resize: vertical;
}

.sidebar-card textarea:focus,
.composer-panel textarea:focus,
.composer-panel input:focus {
  outline: 2px solid rgba(23, 108, 184, 0.14);
  border-color: rgba(23, 108, 184, 0.36);
}

.sidebar-action,
.secondary-action {
  background: rgba(23, 108, 184, 0.1);
  color: var(--primary);
  border-radius: 14px;
  padding: 12px 14px;
}

.primary-action {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #f6fbff;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 12px 22px rgba(23, 108, 184, 0.18);
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.hero-panel h2 {
  font-size: clamp(28px, 3vw, 38px);
}

.hero-badges span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(23, 108, 184, 0.08);
  color: var(--primary);
}

.toolbar-panel {
  display: grid;
  gap: 14px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.timeline-panel,
.handover-panel {
  min-height: 660px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.panel-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.timeline-list,
.handover-list {
  display: grid;
  gap: 14px;
}

.timeline-item,
.handover-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.time-badge {
  padding: 12px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(23, 108, 184, 0.12), rgba(18, 167, 196, 0.12));
  text-align: center;
  font-weight: 700;
  color: var(--primary-strong);
}

.timeline-card,
.handover-card-item,
.preview-card {
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f4faff 100%);
  border: 1px solid var(--line);
}

.timeline-card-header,
.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.timeline-card-header strong,
.handover-card-item strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-meta,
.timeline-note,
.handover-meta,
.record-table td,
.record-table th,
.composer-panel span,
.preview-card p {
  line-height: 1.55;
}

.timeline-meta,
.handover-meta {
  color: var(--muted);
  font-size: 13px;
}

.timeline-note {
  margin: 0;
}

.timeline-handover {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(18, 167, 196, 0.08);
  border: 1px solid rgba(18, 167, 196, 0.14);
}

.timeline-handover-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.timeline-handover p {
  margin: 0;
  line-height: 1.6;
}

.timeline-tag,
.handover-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(18, 167, 196, 0.12);
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
}

.record-table-wrap {
  overflow: auto;
}

.record-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  table-layout: fixed;
}

.record-table th,
.record-table td {
  padding: 16px 14px;
  text-align: left;
  vertical-align: top;
}

.record-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding-top: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.record-table tbody td {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  border-top: 1px solid rgba(62, 120, 177, 0.1);
  border-bottom: 1px solid rgba(62, 120, 177, 0.14);
}

.record-table tbody tr td:first-child {
  border-left: 1px solid rgba(62, 120, 177, 0.14);
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
}

.record-table tbody tr td:last-child {
  border-right: 1px solid rgba(62, 120, 177, 0.14);
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
}

.record-table th:nth-child(1),
.record-table td:nth-child(1) {
  width: 86px;
}

.record-table th:nth-child(2),
.record-table td:nth-child(2) {
  width: 118px;
}

.record-table th:nth-child(4),
.record-table td:nth-child(4) {
  width: 116px;
}

.record-table th:nth-child(5),
.record-table td:nth-child(5) {
  width: 156px;
}

.record-table td strong,
.record-table td span {
  display: block;
}

.record-table td strong {
  display: block;
  margin-bottom: 4px;
}

.table-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(23, 108, 184, 0.1);
  color: var(--primary-strong);
  font-weight: 700;
  white-space: nowrap;
}

.scene-cell strong,
.staff-cell strong {
  font-size: 15px;
  line-height: 1.35;
}

.scene-cell span,
.staff-cell span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.content-cell,
.handover-cell {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.handover-cell {
  color: var(--ink);
}

.scene-cell,
.staff-cell {
  word-break: keep-all;
}

.empty-note {
  color: var(--muted);
}

.composer-panel {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 18px;
}

.composer-grid label,
.full-width,
.chip-section {
  display: grid;
  gap: 8px;
}

.composer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-copy {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(23, 108, 184, 0.1);
  color: var(--primary);
}

.mini-copy:hover,
.shift-chip:hover,
.view-tab:hover,
.filter-pill:hover,
.category-chip:hover,
.sidebar-action:hover,
.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

@media (max-width: 1180px) {
  .dashboard-shell,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .composer-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .dashboard-shell {
    width: min(100% - 20px, 100%);
    margin: 10px auto 18px;
  }

  .brand-block,
  .sidebar-card,
  .hero-panel,
  .toolbar-panel,
  .panel-surface {
    padding: 16px;
    border-radius: 22px;
  }

  .hero-panel,
  .timeline-item,
  .handover-item,
  .composer-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    display: grid;
    align-items: start;
  }

  .time-badge {
    width: fit-content;
  }
}