:root {
  color-scheme: light;
  --canvas: #f6f8fc;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ef;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --coral: #d94c3d;
  --coral-soft: #fff0ed;
  --amber: #ac6a00;
  --amber-soft: #fff6db;
  --green: #19734a;
  --green-soft: #e7f7ee;
  --purple: #6950ae;
  --purple-soft: #f0edff;
  --shadow: 0 10px 26px rgba(23, 32, 51, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #202b42;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand {
  padding: 0 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: #1f4fd6;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 800;
}

.primary-nav {
  display: grid;
  gap: 4px;
  margin-top: 42px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: #596579;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--ink);
  background: #f4f6fa;
}

.nav-item.active {
  color: #1647d1;
  background: var(--blue-soft);
}

.nav-symbol {
  width: 14px;
  color: currentcolor;
  font-size: 12px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
}

.account {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  color: #344054;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

.account:hover {
  background: #f4f6fa;
}

.avatar {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  background: #7656bf;
  border-radius: 50%;
  font-size: 13px;
}

.account-more {
  margin-left: auto;
  color: var(--muted);
}

.main-content {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 28px 52px 72px;
}

.topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-brand {
  display: none;
}

.view-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: #1c2740;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.scenario-control {
  position: relative;
}

.scenario-control::after {
  position: absolute;
  top: 50%;
  right: 12px;
  pointer-events: none;
  color: var(--muted);
  content: "+";
  transform: translateY(-50%) rotate(45deg);
}

select {
  min-height: 38px;
  appearance: none;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #344054;
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
}

.briefing-intro {
  margin: 68px 0 38px;
}

.date-line {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 750;
}

.briefing-intro h2 {
  max-width: 700px;
  margin: 0;
  color: #172033;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.summary {
  max-width: 590px;
  margin: 14px 0 0;
  color: #526075;
  font-size: 17px;
  line-height: 1.5;
}

.product-context {
  max-width: 590px;
  margin: 14px 0 0;
  color: #344054;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
}

.product-context + .summary {
  margin-top: 8px;
}

.briefing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: 44px;
  align-items: start;
}

.briefing-primary,
.briefing-secondary {
  display: grid;
  gap: 34px;
}

.briefing-section {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-heading h3 {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.item-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.briefing-item {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 17px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.briefing-item::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  content: "";
}

.briefing-item.important::before {
  background: var(--coral);
}

.briefing-item.confirm::before {
  background: var(--amber);
}

.briefing-item.note::before {
  background: var(--purple);
}

.briefing-item.complete::before {
  background: var(--green);
}

.item-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-topmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.item-time,
.item-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.item-time {
  color: #b43b2d;
  background: var(--coral-soft);
}

.item-tag {
  color: var(--amber);
  background: var(--amber-soft);
}

.priority-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 4px;
  color: #1647d1;
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.item-title {
  margin: 0;
  color: #1e293b;
  font-size: 16px;
  line-height: 1.3;
}

.item-body {
  margin: 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.45;
}

.item-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 3px;
}

.reason-button,
.secondary-button,
.text-action,
.primary-button {
  min-height: 34px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 750;
}

.reason-button,
.text-action {
  padding: 0;
  border: 0;
  color: #53627a;
  background: transparent;
}

.reason-button:hover,
.text-action:hover {
  color: var(--blue);
}

.source-label {
  margin-left: auto;
  color: #8a94a6;
  font-size: 12px;
  font-weight: 600;
}

.primary-button,
.secondary-button {
  padding: 0 12px;
}

.primary-button {
  border: 1px solid #245bdd;
  color: #ffffff;
  background: var(--blue);
}

.primary-button:hover {
  background: #1f55d2;
}

.secondary-button {
  border: 1px solid var(--line);
  color: #455267;
  background: #ffffff;
}

.secondary-button:hover {
  border-color: #bec9d9;
  background: #f8fafc;
}

.completion-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #4d5e57;
  font-size: 14px;
  line-height: 1.45;
}

.completion-check {
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 900;
}

.empty-state {
  max-width: 620px;
  padding: 28px 0 4px;
  border-top: 1px solid var(--line);
}

.empty-state h3 {
  margin: 0;
  color: #26354a;
  font-size: 22px;
}

.empty-state p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.calendar-setup {
  max-width: 720px;
  display: grid;
  gap: 22px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.calendar-setup h3 {
  margin: 8px 0 0;
  color: #26354a;
  font-size: 24px;
  line-height: 1.2;
}

.calendar-setup > div > p:not(.eyebrow) {
  max-width: 600px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.calendar-connection-list {
  display: grid;
  gap: 10px;
}

.calendar-connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-connection h4 {
  margin: 0;
  color: #1e293b;
  font-size: 15px;
}

.calendar-connection p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.connection-status {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.connection-status p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.details-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(20, 32, 51, 0.2);
}

.details-dialog::backdrop {
  background: rgba(24, 33, 51, 0.3);
}

.dialog-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.details-dialog h2 {
  margin: 16px 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

.details-dialog > p {
  margin: 0;
  color: #5e6b7d;
  font-size: 15px;
  line-height: 1.5;
}

.dialog-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 9px 14px;
  margin: 22px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #57667a;
  font-size: 13px;
}

.dialog-meta dt {
  color: #8a94a6;
}

.dialog-meta dd {
  margin: 0;
  font-weight: 650;
}

.dialog-form {
  margin: 0 0 16px;
}

.dialog-form label {
  display: grid;
  gap: 7px;
  color: #556379;
  font-size: 13px;
  font-weight: 700;
}

.dialog-form input {
  min-height: 40px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #556379;
  background: #ffffff;
  font-size: 18px;
  line-height: 1;
}

.dialog-close {
  min-width: 88px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  font-size: 17px;
}

.theme-toggle[aria-pressed="true"] {
  color: #1647d1;
  border-color: #acc3ff;
  background: var(--blue-soft);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 12px 15px;
  border: 1px solid #a8d8bc;
  border-radius: 6px;
  color: #1d5d3a;
  background: #f0fbf4;
  box-shadow: 0 12px 30px rgba(23, 32, 51, 0.13);
  font-size: 14px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.test-mode .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.test-mode .sidebar {
  display: none;
}

body.test-mode .main-content {
  max-width: 1040px;
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 20px 22px 54px;
  }

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

  .mobile-brand {
    display: flex;
  }

  .view-title {
    display: none;
  }

  .briefing-intro {
    margin: 54px 0 32px;
  }

  .briefing-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 16px 16px 42px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .mobile-brand {
    font-size: 13px;
  }

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

  select {
    max-width: 174px;
    font-size: 12px;
  }

  .briefing-intro {
    margin: 46px 0 28px;
  }

  .briefing-intro h2 {
    font-size: 32px;
  }

  .summary {
    font-size: 16px;
  }

  .briefing-item {
    padding: 16px;
  }

  .calendar-connection {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-label {
    width: 100%;
    margin-left: 0;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #10151e;
  --surface: #18212e;
  --ink: #f3f6fb;
  --muted: #aeb9cb;
  --line: #344154;
  --blue: #7d9eff;
  --blue-soft: #223864;
  --coral: #ff8c7d;
  --coral-soft: #4a2927;
  --amber: #f2bd5b;
  --amber-soft: #463818;
  --green: #7dd6a4;
  --green-soft: #1d4534;
  --purple: #b9a4ff;
  --purple-soft: #362b58;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .brand,
:root[data-theme="dark"] .mobile-brand,
:root[data-theme="dark"] h1,
:root[data-theme="dark"] .briefing-intro h2,
:root[data-theme="dark"] .item-title,
:root[data-theme="dark"] .empty-state h3,
:root[data-theme="dark"] .calendar-setup h3,
:root[data-theme="dark"] .calendar-connection h4 {
  color: var(--ink);
}

:root[data-theme="dark"] .nav-item,
:root[data-theme="dark"] .account,
:root[data-theme="dark"] .product-context,
:root[data-theme="dark"] select,
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .dialog-form label {
  color: #d5ddec;
}

:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .account:hover,
:root[data-theme="dark"] .secondary-button:hover {
  background: #222e3f;
}

:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .theme-toggle[aria-pressed="true"] {
  color: #b9caff;
}

:root[data-theme="dark"] .nav-item.active {
  background: var(--blue-soft);
}

:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .details-dialog {
  background: var(--surface);
}

:root[data-theme="dark"] .secondary-button:hover {
  border-color: #52637b;
}

:root[data-theme="dark"] .reason-button,
:root[data-theme="dark"] .text-action,
:root[data-theme="dark"] .details-dialog > p,
:root[data-theme="dark"] .dialog-meta,
:root[data-theme="dark"] .completion-line {
  color: #b8c3d3;
}

:root[data-theme="dark"] .item-body,
:root[data-theme="dark"] .summary {
  color: #c3ccda;
}

:root[data-theme="dark"] .priority-label,
:root[data-theme="dark"] .theme-toggle[aria-pressed="true"] {
  color: #b9caff;
  background: var(--blue-soft);
}

:root[data-theme="dark"] .details-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}
