:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #fbfcfe;
  --ink: #202939;
  --muted: #697589;
  --line: #dce3ec;
  --blue: #5f8fdc;
  --blue-strong: #3f70c1;
  --green: #5fae95;
  --mint: #e3f4ee;
  --yellow: #fff5d9;
  --danger: #c04d5a;
  --holiday: #fff7eb;
  --shadow: 0 14px 34px rgba(38, 50, 74, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Segoe UI",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    system-ui,
    sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 254, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #dbe9ff, #dff4e9);
  color: #315b88;
  font-weight: 800;
}

.app-header h1 {
  font-size: 20px;
  letter-spacing: 0;
}

.app-header p,
.hint,
.field span,
.field em,
.toggle-row span,
.record-head p,
.recorder-display span,
.empty-day,
.empty-log,
.log-time,
.holiday-label {
  color: var(--muted);
}

.header-actions,
.calendar-actions,
.calendar-nav,
.record-actions,
.log-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
  gap: 12px;
  padding: 12px;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.main-panel,
.record-card,
.pipeline-card,
.results-panel,
.email-dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-section {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.side-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.settings-stack {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.settings-stack .panel-section,
.settings-stack .results-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.settings-stack .panel-section {
  border-bottom: 1px solid var(--line);
}

.compact-title {
  align-items: baseline;
  justify-content: flex-start;
}

.compact-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-title .status-badge {
  margin-left: auto;
}

.compact-field {
  gap: 5px;
}

.compact-field input {
  min-height: 36px;
}

.compact-toggle {
  padding: 8px;
}

.section-title,
.calendar-toolbar,
.results-head,
.record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-title h2,
.calendar-toolbar h2,
.record-head h2,
.results-head h2 {
  font-size: 16px;
  letter-spacing: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #6a7891;
  font-size: 12px;
  font-weight: 800;
}

.field,
.meeting-form {
  display: grid;
  gap: 7px;
}

.field em {
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.field input,
.field select,
.inline-form input,
.inline-form select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.meeting-card strong,
.meeting-card span,
.log-main p,
.edit-chip,
.mini-chip,
.email-preview dd,
.email-preview pre,
.detail-list dd {
  overflow-wrap: anywhere;
}

.field input:focus,
.field select:focus,
.inline-form input:focus,
.inline-form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(95, 143, 220, 0.16);
}

.field input.field-error,
.inline-form input.field-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(192, 77, 90, 0.14);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.datetime-wheel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1.1fr 0.8fr 0.8fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.wheel-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.wheel-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.wheel-field select {
  width: 100%;
  min-height: 38px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: center;
}

.wheel-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(95, 143, 220, 0.16);
  outline: 0;
}

.holiday-inputs {
  grid-template-columns: 0.9fr 1.1fr;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.toggle-row div {
  display: grid;
  gap: 2px;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: relative;
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d4dce8;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(32, 41, 57, 0.18);
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.primary-button,
.secondary-button,
.ghost-button,
.small-add-button,
.icon-button,
.template-chip,
.meeting-card,
.quick-add-list button,
.segmented-control button,
.edit-chip button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.ghost-button,
.small-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 7px;
  font-weight: 800;
}

.small-add-button {
  border-radius: 7px;
  background: #eef3f8;
  color: var(--ink);
}

.small-add-button:hover {
  background: #e2e9f1;
}

.primary-button {
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-strong);
}

.secondary-button {
  background: #eaf2ff;
  color: #315f9d;
}

.secondary-button:hover {
  background: #dfeaff;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover {
  background: #f0f4f8;
}

.danger-text {
  color: #9e3946;
}

.form-actions {
  justify-content: stretch;
}

.form-actions button {
  flex: 1;
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 7px;
  background: #eef3f8;
  color: var(--ink);
}

.icon-button:hover {
  background: #e2e9f1;
}

.chip-preview,
.editable-chip-list,
.quick-add-list,
.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-chip,
.edit-chip,
.empty-chip,
.quick-add-list button,
.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-chip.invalid {
  background: #f9e4e8;
  color: #9e3946;
}

.edit-chip {
  background: #f4f8fc;
  color: var(--ink);
}

.holiday-chip {
  background: var(--holiday);
  color: #8a5b23;
}

.edit-chip button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
}

.edit-chip button:hover {
  background: rgba(32, 41, 57, 0.08);
}

.quick-add-list button:hover,
.template-chip:hover {
  background: #e2e9f1;
}

.template-chip.active {
  background: var(--mint);
  color: #256a5a;
}

.compact-chip-list {
  max-height: 74px;
  overflow: auto;
}

.compact-template-list {
  flex-wrap: nowrap;
}

.compact-template-list .template-chip {
  flex: 1;
  justify-content: center;
}

.manager-chip-list {
  max-height: 220px;
  overflow: auto;
}

.hint {
  line-height: 1.5;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.live {
  background: var(--mint);
  color: #26705c;
}

.status-badge.sent {
  background: #e8efff;
  color: #315f9d;
}

.status-badge.pending {
  background: var(--yellow);
  color: #8a6419;
}

.status-badge.error {
  background: #f9e4e8;
  color: #9e3946;
}

.status-badge.muted {
  background: #eef0f4;
  color: #7a8494;
}

.main-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.calendar-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.range-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.range-button span {
  font-size: 16px;
  font-weight: 800;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
}

.segmented-control button {
  min-width: 44px;
  min-height: 31px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented-control button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(26, 34, 51, 0.12);
}

.calendar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-right: auto;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.legend-swatch,
.legend-dot {
  display: inline-block;
  flex: 0 0 auto;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-swatch.upcoming {
  background: #8eaee0;
}

.legend-swatch.active {
  background: #d68d98;
}

.legend-swatch.done {
  background: #a5aebd;
}

.legend-swatch.sent {
  background: #74b69a;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d68d98;
}

.calendar-grid {
  min-height: 0;
  overflow-x: auto;
}

.calendar-grid.time-grid {
  position: relative;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  height: 100%;
  min-height: 420px;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  height: 100%;
  min-height: 0;
}

.day-grid {
  display: grid;
  height: 100%;
  min-height: 420px;
}

.day-grid .calendar-day {
  min-width: 0;
  border-right: 0;
}

.calendar-day {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 132px;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition:
    background 120ms ease,
    box-shadow 120ms ease;
}

.week-grid .calendar-day {
  min-width: 150px;
  min-height: 0;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.today {
  background: #f7fbff;
}

.calendar-day.selected-day {
  box-shadow: inset 0 0 0 2px rgba(95, 143, 220, 0.5);
}

.calendar-day.outside-month {
  background: #f8fafc;
}

.calendar-day.holiday {
  background: var(--holiday);
}

.calendar-day.substitute-holiday .holiday-label,
.time-grid-day-head.substitute-holiday small {
  color: #c04d5a;
}

.calendar-day.sunday .day-head span,
.calendar-day.sunday .day-head strong,
.calendar-day.substitute-holiday .day-head span,
.calendar-day.substitute-holiday .day-head strong {
  color: #c04d5a;
}

.calendar-day.saturday .day-head span,
.calendar-day.saturday .day-head strong {
  color: #315f9d;
}

.calendar-day.drop-target {
  background: #edf6ff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.time-grid-shell {
  min-width: 840px;
}

.time-grid-shell.single-day {
  min-width: 0;
}

.time-grid-shell:not(.single-day) {
  width: var(--time-grid-total-width);
  min-width: var(--time-grid-total-width);
}

.time-grid-header,
.time-grid-body {
  display: grid;
}

.time-grid-header {
  grid-template-columns: var(--time-column-width) repeat(var(--day-count), var(--day-column-width));
}

.time-grid-body {
  grid-template-columns: var(--time-column-width) auto;
  padding-top: 10px;
  box-sizing: border-box;
}

.time-grid-header {
  position: sticky;
  top: 0;
  z-index: 8;
  background: #fff;
  box-shadow: 0 1px 0 rgba(213, 222, 235, 0.92);
}

.time-grid-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  min-height: 62px;
  padding: 6px 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f6f8fb;
}

.time-display-control {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  width: 100%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.time-display-control select {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0 2px;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  outline: 0;
}

.time-grid-day-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 62px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.time-grid-day-head:last-child,
.time-grid-column:last-child {
  border-right: 0;
}

.time-grid-day-head.today {
  background: #f7fbff;
}

.time-grid-day-head.selected-day {
  box-shadow: inset 0 0 0 2px rgba(95, 143, 220, 0.45);
}

.time-grid-day-head.holiday {
  background: var(--holiday);
}

.time-grid-day-head.sunday span,
.time-grid-day-head.sunday strong,
.time-grid-day-head.substitute-holiday span,
.time-grid-day-head.substitute-holiday strong {
  color: #c04d5a;
}

.time-grid-day-head.saturday span,
.time-grid-day-head.saturday strong {
  color: #315f9d;
}

.time-grid-head-button {
  display: inline-grid;
  justify-items: start;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.time-grid-head-button span {
  font-size: 12px;
  font-weight: 800;
}

.time-grid-head-button strong {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
}

.time-grid-day-head.today .time-grid-head-button strong {
  background: #dceaff;
  color: #315f9d;
}

.time-grid-day-head small {
  grid-column: 1 / 2;
  color: #9a6325;
  font-size: 11px;
  font-weight: 800;
}

.time-grid-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #d8e2ee;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.time-grid-add:hover {
  color: #315f9d;
  border-color: #b8cff1;
  background: #f2f7ff;
}

.time-grid-hours {
  position: sticky;
  left: 0;
  z-index: 6;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.time-grid-hour {
  position: relative;
  height: 104px;
  border-bottom: 1px solid var(--line);
  background: inherit;
}

.time-grid-hour span {
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.time-grid-columns {
  display: grid;
  grid-template-columns: repeat(var(--day-count), var(--day-column-width));
  width: calc(var(--time-grid-total-width) - var(--time-column-width));
}

.time-grid-column {
  position: relative;
  display: block;
  width: var(--day-column-width);
  min-width: var(--day-column-width);
  min-height: var(--grid-height);
  border-right: 1px solid var(--line);
  border-bottom: 0;
  background: #fff;
  overflow: hidden;
}

.time-grid-column.today {
  background: #fbfdff;
}

.time-grid-column.holiday {
  background: #fffaf2;
}

.time-grid-column.selected-day {
  box-shadow: inset 0 0 0 2px rgba(95, 143, 220, 0.45);
}

.time-grid-column.drop-target {
  background: #edf6ff;
}

.time-grid-lines {
  height: var(--grid-height);
}

.time-grid-line {
  height: 104px;
  border-bottom: 1px solid var(--line);
}

.time-grid-events {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.time-grid-slots {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.time-grid-slot {
  position: absolute;
  left: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.time-grid-slot-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cfe0f5;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #315f9d;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  box-shadow: 0 8px 20px rgba(37, 64, 102, 0.08);
  transform: translateY(2px);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background 120ms ease;
}

.time-grid-slot:hover .time-grid-slot-add,
.time-grid-slot-add:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.time-grid-slot-add:hover {
  background: #f2f7ff;
}

.time-grid-shell.single-day .time-grid-header,
.time-grid-shell.single-day .time-grid-body {
  width: 100%;
  min-width: 0;
  grid-template-columns: var(--time-column-width) minmax(0, 1fr);
}

.time-grid-shell.single-day .time-grid-columns {
  grid-template-columns: minmax(0, 1fr);
  width: auto;
}

.time-grid-shell.single-day .time-grid-column {
  width: auto;
  min-width: 0;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.month-grid .day-head {
  min-height: 31px;
  padding: 4px 8px;
}

.month-grid .day-head strong {
  width: 24px;
  height: 24px;
}

.month-grid .day-head span {
  font-size: 12px;
}

.day-head span {
  color: var(--ink);
  font-weight: 800;
}

.day-head strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.today .day-head strong {
  background: #dceaff;
  color: #315f9d;
}

.calendar-day.sunday.today .day-head strong {
  background: #fde5e8;
  color: #c04d5a;
}

.holiday-label {
  min-height: 22px;
  padding: 4px 10px 0;
  font-size: 12px;
  font-weight: 800;
  color: #9a6325;
}

.month-grid .holiday-label {
  min-height: 18px;
  padding: 2px 8px 0;
  font-size: 11px;
}

.meeting-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.month-grid .meeting-list {
  padding: 6px 8px 8px;
  overflow-y: hidden;
}

.month-grid .calendar-day:has(.meeting-card) .meeting-list {
  overflow-y: auto;
}

.month-grid .meeting-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.month-grid .calendar-day:has(.meeting-card):hover .meeting-list::-webkit-scrollbar {
  width: 6px;
}

.month-grid .calendar-day:has(.meeting-card):hover .meeting-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.meeting-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1px solid #dfe6ef;
  border-left: 4px solid #9fbce8;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  text-align: left;
  overflow: hidden;
}

.meeting-card.status-upcoming {
  border-left-color: #8eaee0;
  background: #f7fbff;
}

.meeting-card.status-active {
  border-left-color: #d68d98;
  background: #fff5f7;
}

.meeting-card.status-done {
  border-left-color: #a5aebd;
  background: #f7f8fa;
}

.meeting-card.status-sent {
  border-left-color: #74b69a;
  background: #f2fbf6;
}

.meeting-main {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.meeting-menu-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  align-self: start;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.meeting-menu-button:hover {
  background: #e6eef7;
  color: var(--ink);
}

.meeting-card.compact {
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 3px;
  padding: 7px 8px;
}

.month-meeting-card {
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: start;
}

.month-meeting-card .meeting-main {
  grid-column: 1;
  gap: 2px;
}

.month-meeting-card .meeting-menu-button {
  grid-column: 3;
}

.month-meeting-card strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
}

.meeting-external-dot {
  grid-column: 2;
  align-self: center;
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 999px;
  background: #d68d98;
}

.meeting-card:hover,
.meeting-card.selected {
  border-color: #92b4e4;
  box-shadow: 0 0 0 2px rgba(146, 180, 228, 0.18);
}

.meeting-card.dragging {
  opacity: 0.55;
}

.meeting-card.sent {
  border-left-color: var(--green);
  background: #f4fbf8;
}

.meeting-card.processing {
  border-left-color: #cfb15f;
  background: var(--yellow);
}

.meeting-card.recording {
  border-left-color: var(--danger);
  background: #fff4f6;
}

.meeting-time {
  color: #41658f;
  font-weight: 800;
}

.meeting-card span,
.meeting-card em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.meeting-card strong {
  font-size: 13px;
  line-height: 1.25;
}

.meeting-meta-line {
  font-weight: 700;
}

.meeting-detail-line {
  display: none;
}

.meeting-event {
  position: absolute;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: start;
  padding: 8px 8px 8px 10px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(35, 52, 78, 0.08);
  pointer-events: auto;
}

.meeting-event .meeting-main {
  gap: 3px;
  align-self: stretch;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 2px;
}

.meeting-event.stacked-event {
  padding: 7px 8px 7px 10px;
}

.meeting-event.stacked-event .meeting-main {
  gap: 4px;
  overflow: hidden;
}

.meeting-event.stacked-event .meeting-title-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.25;
}

.meeting-event.stacked-event .meeting-meta-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meeting-event strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
}

.meeting-event .meeting-meta-line,
.meeting-event .meeting-detail-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-day {
  min-height: 42px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  grid-auto-flow: column;
  justify-content: center;
  place-items: center;
  gap: 5px;
  text-align: center;
  background: transparent;
  color: var(--muted);
}

.quick-add-day {
  opacity: 0;
  transition:
    opacity 120ms ease,
    background 120ms ease;
}

.calendar-day:hover .quick-add-day,
.quick-add-day:focus-visible {
  opacity: 1;
}

.quick-add-day:hover {
  background: #f1f7ff;
  border-color: #b8cff1;
  color: #315f9d;
}

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

.record-card,
.pipeline-card,
.results-panel {
  padding: 12px;
}

.google-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.google-auth-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.google-auth-status.connected {
  color: #26705c;
}

.google-auth-status.error {
  color: var(--danger);
}

.google-auth-row .ghost-button {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.recorder-display {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 0;
}

.pulse-ring {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e6efff, #e6f6ef);
  color: #315f9d;
}

.pulse-ring.recording {
  animation: pulse 1.4s ease-in-out infinite;
  background: linear-gradient(135deg, #f8e4e8, #fff1df);
  color: #a13f4b;
}

.recorder-display strong {
  font-size: 24px;
  letter-spacing: 0;
}

.recorder-display span {
  max-width: 190px;
  font-size: 12px;
}

.record-actions {
  justify-content: stretch;
  flex-wrap: wrap;
}

.record-actions .primary-button,
.record-actions .secondary-button,
.record-actions .ghost-button {
  flex: 1;
  min-width: 0;
  padding-inline: 10px;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
  word-break: keep-all;
}

.record-actions svg,
.record-actions i {
  flex: 0 0 18px;
}

.record-actions #testSummaryBtn,
.record-actions #uploadAudioBtn {
  font-size: 12px;
}

.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 6px 0 0;
  margin: 0;
  list-style: none;
}

.pipeline-steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pipeline-steps span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
}

.pipeline-steps li.active {
  color: #315f9d;
  border-color: #b8cff1;
  background: #f1f7ff;
}

.pipeline-steps li.active span {
  background: var(--blue);
}

.pipeline-steps li.done {
  color: #2b715e;
  border-color: #bfe1d4;
  background: #f4fbf8;
}

.pipeline-steps li.done span {
  background: var(--green);
}

.results-panel {
  margin: 0;
}

.results-head {
  margin-bottom: 12px;
}

.send-log {
  display: grid;
  gap: 10px;
}

.empty-log {
  min-height: 110px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.log-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.log-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.log-main h3 {
  font-size: 15px;
}

.log-main p {
  color: var(--ink);
}

.action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f0f4f8;
  color: var(--muted);
  font-size: 12px;
}

.action-list .organizer-chip {
  background: #fff5d9;
  color: #8a6419;
}

.meta-list span {
  background: #f6f8fb;
}

.local-vault-panel {
  display: grid;
  gap: 12px;
}

.vault-summary {
  display: grid;
  gap: 10px;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vault-stat {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.vault-stat strong {
  font-size: 15px;
}

.vault-stat span,
.vault-note-list span,
.vault-empty span {
  color: var(--muted);
  font-size: 12px;
}

.vault-note-list {
  display: grid;
  gap: 4px;
}

.vault-empty {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.local-vault-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.email-dialog,
.form-dialog,
.picker-dialog,
.action-dialog {
  width: min(780px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
}

.form-dialog {
  width: min(520px, calc(100vw - 28px));
}

.picker-dialog {
  width: min(460px, calc(100vw - 28px));
}

.action-dialog {
  width: min(420px, calc(100vw - 28px));
}

.meeting-detail-dialog {
  width: min(540px, calc(100vw - 28px));
}

.email-dialog::backdrop,
.form-dialog::backdrop,
.picker-dialog::backdrop,
.action-dialog::backdrop {
  background: rgba(30, 41, 59, 0.45);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-size: 17px;
}

.email-preview {
  padding: 14px;
}

.dialog-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 14px;
}

.action-dialog-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.action-dialog-body p {
  color: var(--muted);
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  color: var(--ink);
  word-break: break-word;
}

.detail-list a {
  color: #315f9d;
  text-decoration: none;
}

.detail-list a:hover {
  text-decoration: underline;
}

.date-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
}

.date-picker-grid strong {
  display: block;
  margin-bottom: 8px;
}

.picker-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.picker-list button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.picker-list button:hover,
.picker-list button.active {
  border-color: #b8cff1;
  background: #f1f7ff;
  color: #315f9d;
}

.email-preview dl {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.email-preview dl div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
}

.email-preview dt {
  color: var(--muted);
  font-weight: 800;
}

.email-preview dd {
  margin: 0;
}

.email-preview-body {
  max-height: 50vh;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  white-space: normal;
  line-height: 1.6;
  color: var(--ink);
}

.email-preview-body p,
.email-preview-body ul {
  margin: 0 0 10px;
}

.email-preview-body ul {
  padding-left: 18px;
}

.mail-section + .mail-section {
  margin-top: 8px;
}

.mail-empty {
  min-height: 16px;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(192, 77, 90, 0.22);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(192, 77, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(192, 77, 90, 0);
  }
}

@media (max-width: 980px) {
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
    height: auto;
    overflow: visible;
  }

  .main-panel {
    min-height: 620px;
  }

  .side-panel {
    overflow: visible;
  }

  .settings-stack {
    grid-template-columns: 1fr;
    overflow: visible;
  }
}

@media (hover: none), (pointer: coarse) {
  .quick-add-day {
    opacity: 1;
  }
}

@media (max-width: 959px), (pointer: coarse) and (max-height: 599px) {
  .settings-stack {
    display: none;
  }

  .app-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .side-panel,
  .main-panel {
    max-height: none;
    overflow: visible;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions button {
    flex: 1;
  }

  .main-panel {
    min-height: auto;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-actions {
    justify-content: space-between;
  }

  .calendar-legend {
    display: none;
  }

  .calendar-grid {
    overflow-x: hidden;
  }

  .day-grid {
    height: auto;
    min-height: 0;
  }

  .day-grid .calendar-day {
    min-height: 0;
  }

  .day-grid .meeting-list {
    max-height: 270px;
    overflow-y: auto;
  }

  .date-picker-only.week-grid,
  .date-picker-only.month-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: none;
    height: auto;
    min-height: 0;
  }

  .date-picker-only .calendar-day {
    min-width: 0;
    min-height: 52px;
    cursor: pointer;
  }

  .date-picker-only .day-head {
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    min-height: 52px;
    padding: 5px;
    border-bottom: 0;
  }

  .date-picker-only .day-head strong {
    width: 26px;
    height: 26px;
  }

  .date-picker-only .holiday-label,
  .date-picker-only .meeting-list {
    display: none;
  }

  .settings-stack {
    grid-template-columns: 1fr;
  }

  .log-item {
    flex-direction: column;
  }

  .log-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px;
  }

  .main-panel {
    min-height: auto;
  }

  .week-grid {
    min-height: 330px;
  }

  .day-grid {
    min-height: 0;
  }

  .month-grid {
    min-height: 520px;
  }

  .date-picker-only.week-grid,
  .date-picker-only.month-grid {
    min-height: 0;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .two-col,
  .holiday-inputs,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .datetime-wheel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .calendar-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .segmented-control {
    width: 100%;
  }

  .calendar-legend {
    display: none;
  }

  .calendar-nav {
    justify-content: flex-end;
  }

  .record-head,
  .results-head,
  .google-auth-row {
    align-items: stretch;
    flex-direction: column;
  }

  .record-actions .primary-button,
  .record-actions .secondary-button,
  .record-actions .ghost-button,
  .google-auth-row .ghost-button,
  .dialog-actions .primary-button {
    width: 100%;
  }

  .dialog-actions {
    justify-content: stretch;
  }

  .email-preview dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .email-preview-body {
    max-height: 42vh;
    padding: 12px;
  }
}
