:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --paper-2: #ebe7de;
  --card: #fffdfa;
  --ink: #20221f;
  --muted: #777971;
  --line: #dcd8cf;
  --accent: #4453d8;
  --accent-dark: #2936a8;
  --accent-soft: #e8eaff;
  --green: #29765b;
  --danger: #b74a44;
  --shadow: 0 18px 50px rgba(50, 48, 42, .12);
  --topbar: 72px;
  --sidebar: 254px;
  --agent: 346px;
  --font-sans: "Noto Sans JP", "Noto Sans", "Noto Sans SC", "Noto Sans KR", "Noto Sans Arabic", "Noto Sans Devanagari", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { overflow-x: hidden; overflow-y: auto; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.ui-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }
.small-note { color: var(--muted); font-size: 12px; }

.primary-button, .quiet-button, .icon-button, .round-button, .send-button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}
.primary-button:hover, .quiet-button:hover, .icon-button:hover, .round-button:hover { transform: translateY(-1px); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 43px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 750;
  font-size: 13px;
}
.primary-button.compact { min-height: 38px; padding: 0 14px; }
.primary-button:disabled { opacity: .45; cursor: wait; }
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 700;
}
.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  font-size: 22px;
}
.round-button {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-size: 20px;
}
.round-button .ui-icon { width: 16px; height: 16px; }
.danger-text { color: var(--danger); }

.welcome {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(260px, 44%) 1fr;
  background:
    radial-gradient(circle at 15% 80%, rgba(68,83,216,.2), transparent 28%),
    linear-gradient(120deg, #ded9cd, #f6f3ed 55%);
}
.welcome-mark {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}
.welcome-mark::before {
  content: "";
  position: absolute;
  inset: 8% 10%;
  border: 1px solid rgba(32,34,31,.18);
  border-radius: 50% 50% 12% 12%;
  transform: rotate(-8deg);
}
.welcome-mark span {
  position: absolute;
  left: 16%;
  right: 8%;
  height: 15%;
  border-radius: 999px;
  background: var(--ink);
  transform: rotate(-14deg);
  box-shadow: var(--shadow);
}
.welcome-mark span:nth-child(1) { top: 20%; }
.welcome-mark span:nth-child(2) { top: 42%; left: 25%; background: var(--accent); }
.welcome-mark span:nth-child(3) { top: 64%; left: 34%; right: 14%; }
.welcome-card {
  align-self: center;
  width: min(620px, calc(100% - 56px));
  padding: 50px;
}
.welcome-card h1 { margin: 0; font-family: var(--font-sans); font-size: clamp(38px, 5vw, 72px); font-weight: 720; line-height: 1.12; letter-spacing: -.045em; }
.welcome-copy { max-width: 520px; margin: 28px 0; color: #585b54; font-size: 16px; line-height: 1.9; }
.login-button { position: relative; z-index: 2; min-width: 240px; touch-action: manipulation; }

.app-shell {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(420px, 1fr) var(--agent);
  grid-template-rows: var(--topbar) minmax(0, 1fr);
}
.app-shell.sidebar-collapsed { grid-template-columns: 0 minmax(420px, 1fr) var(--agent); }
.app-shell.agent-collapsed { grid-template-columns: var(--sidebar) minmax(420px, 1fr) 0; }
.app-shell.sidebar-collapsed.agent-collapsed { grid-template-columns: 0 minmax(420px, 1fr) 0; }
.app-shell.sidebar-collapsed > .sidebar, .app-shell.agent-collapsed > .agent-panel { display: none; }
.app-shell.settings-mode { grid-template-columns: minmax(0, 1fr); }
.app-shell.settings-mode > .sidebar, .app-shell.settings-mode > .agent-panel { display: none; }
.app-shell.settings-mode > .calendar-main { grid-column: 1 / -1; }
.app-shell.settings-mode .topbar { grid-template-columns: auto 1fr auto; }

.topbar {
  z-index: 20;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr auto;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(245,242,235,.92);
  backdrop-filter: blur(14px);
}
.brand-wrap { display: flex; align-items: center; gap: 8px; padding: 0 22px; }
.app-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-sans); font-size: 23px; font-weight: 800; letter-spacing: -.05em; }
.brand-glyph { position: relative; width: 23px; height: 23px; }
.brand-glyph i { position: absolute; width: 17px; height: 7px; border-radius: 99px; background: var(--ink); transform: rotate(-45deg); }
.brand-glyph i:first-child { top: 4px; left: 0; }
.brand-glyph i:last-child { right: 0; bottom: 3px; background: var(--accent); }
.view-tabs { display: flex; justify-content: center; gap: 3px; min-width: 0; }
.view-tabs button { padding: 9px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 750; white-space: nowrap; }
.view-tabs button.active { background: var(--ink); color: #fff; }
.top-actions { display: flex; align-items: center; gap: 8px; padding-right: 16px; }
.new-task-action { position: relative; display: flex; align-items: center; gap: 4px; }
.inline-help-button { display: grid; width: 28px; height: 32px; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.inline-help-button .ui-icon { width: 16px; height: 16px; }
.action-help-popover { position: absolute; z-index: 60; top: calc(100% + 11px); right: 0; width: min(320px, calc(100vw - 24px)); padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); box-shadow: var(--shadow); }
.action-help-popover::before { content: ""; position: absolute; top: -6px; right: 19px; width: 10px; height: 10px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--card); transform: rotate(45deg); }
.action-help-popover strong { font-size: 12px; }
.action-help-popover p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.mobile-only { display: none; }

.sidebar, .agent-panel { min-height: 0; background: var(--paper-2); }
.sidebar { grid-row: 2; grid-column: 1; padding: 25px 14px 18px; border-right: 1px solid var(--line); overflow-y: auto; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 17px; }
.panel-heading h2 { margin: 0; font-family: var(--font-sans); font-size: 18px; font-weight: 750; }
.group-list { display: grid; gap: 5px; }
.group-item {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 13px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.group-item:hover { background: rgba(255,255,255,.55); }
.group-item.active { border-color: var(--line); background: var(--card); box-shadow: 0 6px 18px rgba(50,48,42,.06); }
.group-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.group-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--group-color, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--group-color, var(--accent)) 15%, transparent); }
.group-dot.all { background: conic-gradient(var(--accent), #c55d73, #d29a48, var(--accent)); }
.group-edit { display: grid; place-items: center; width: 25px; height: 25px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.sidebar-foot { margin: 30px 8px 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; }

.calendar-main { grid-row: 2; grid-column: 2; min-width: 0; min-height: 0; overflow: hidden; background: var(--card); }
.calendar-section { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 21px; border-bottom: 1px solid var(--line); }
.date-navigation { display: flex; align-items: center; gap: 7px; }
.date-navigation > div { margin-left: 8px; }
.date-navigation h1 { min-width: 180px; margin: 0; font-family: var(--font-sans); font-size: 24px; font-weight: 760; line-height: 1; letter-spacing: -.035em; }
.active-group-summary { max-width: 42%; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.calendar { min-height: 0; overflow: auto; }

.month-view { min-width: 760px; height: 100%; display: grid; grid-template-rows: 31px repeat(6, minmax(92px, 1fr)); }
.month-weekdays, .month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-weekdays { border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.month-weekdays span { display: grid; place-items: center; }
.month-day { min-width: 0; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); cursor: pointer; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day.outside { background: #faf8f3; color: #b7b4ad; }
.month-day.today { background: #f1f2ff; }
.day-number { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 750; }
.today .day-number { background: var(--accent); color: #fff; }
.month-events { display: grid; gap: 3px; margin-top: 5px; }
.month-event { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 5px; overflow: hidden; padding: 4px 6px 4px 9px; border: 0; border-radius: 5px; background: color-mix(in srgb, var(--event-color) 13%, white); color: var(--ink); text-align: left; white-space: nowrap; cursor: pointer; font-size: 9px; font-weight: 700; }
.month-event strong { overflow: hidden; text-overflow: ellipsis; }
.month-event small { padding: 1px 4px; border-radius: 99px; background: color-mix(in srgb, var(--event-color) 18%, white); color: var(--event-color); font-size: 7px; font-weight: 850; }
.month-event::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--event-color); }
.month-event.dimmed { opacity: .27; }
.month-event.multi-start { margin-right: -9px; border-radius: 5px 0 0 5px; }
.month-event.multi-middle { margin-inline: -9px; border-radius: 0; }
.month-event.multi-end { margin-left: -9px; border-radius: 0 5px 5px 0; }
.month-event.multi-middle::before, .month-event.multi-end::before { display: none; }
.more-events { color: var(--muted); font-size: 9px; padding-left: 6px; }

.two-week-view { min-width: 920px; min-height: 100%; display: grid; grid-template-columns: repeat(7, minmax(128px, 1fr)); grid-template-rows: repeat(2, minmax(230px, 1fr)); gap: 10px; padding: 12px; background: var(--paper); }
.two-week-day { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; box-shadow: 0 4px 12px rgba(40,38,34,.04); }
.two-week-day.today { border-color: #aeb5ef; background: #f5f6ff; box-shadow: 0 0 0 3px rgba(68,83,216,.07); }
.two-week-day > header { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 7px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.two-week-day > header span { color: var(--muted); font-size: 9px; font-weight: 800; }
.two-week-day > header strong { font-size: 14px; }
.two-week-day > header small { color: var(--muted); font-size: 8px; }
.two-week-events { display: grid; gap: 5px; margin-top: 9px; }
.two-week-event { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-width: 0; padding: 7px 8px; border: 0; border-left: 3px solid var(--event-color); border-radius: 7px; background: color-mix(in srgb, var(--event-color) 12%, white); text-align: left; cursor: pointer; }
.two-week-event > span { color: var(--muted); font-size: 8px; }
.two-week-event > strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.two-week-event > small { padding: 2px 4px; border-radius: 99px; background: var(--event-color); color: #fff; font-size: 7px; }
.two-week-event.dimmed { opacity: .28; }
.two-week-more { padding-left: 7px; color: var(--muted); font-size: 8px; }

.timeline-view { min-width: var(--timeline-width, 760px); display: grid; grid-template-columns: 48px 1fr; }
.timeline-corner { position: sticky; left: 0; z-index: 5; height: 54px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.timeline-days-head { display: grid; grid-template-columns: repeat(var(--day-count), minmax(var(--day-min, 110px), 1fr)); height: 54px; border-bottom: 1px solid var(--line); }
.timeline-day-head { display: grid; place-content: center; border-right: 1px solid var(--line); text-align: center; }
.timeline-day-head strong { font-family: var(--font-sans); font-size: 17px; font-weight: 760; }
.timeline-day-head span { color: var(--muted); font-size: 9px; }
.timeline-day-head.today { background: var(--accent-soft); color: var(--accent-dark); }
.time-labels { position: sticky; left: 0; z-index: 4; height: 1152px; border-right: 1px solid var(--line); background: var(--card); }
.time-label { position: absolute; right: 8px; transform: translateY(-50%); color: #999b95; font-size: 9px; }
.timeline-days { position: relative; display: grid; grid-template-columns: repeat(var(--day-count), minmax(var(--day-min, 110px), 1fr)); height: 1152px; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--line) 48px); }
.timeline-day { position: relative; border-right: 1px solid var(--line); cursor: pointer; }
.timeline-day.today { background: rgba(68,83,216,.035); }
.time-event { position: absolute; left: 4px; right: 4px; min-height: 23px; overflow: hidden; padding: 6px 6px 6px 9px; border: 0; border-left: 3px solid var(--event-color); border-radius: 6px; background: color-mix(in srgb, var(--event-color) 16%, white); color: var(--ink); text-align: left; cursor: pointer; font-size: 9px; line-height: 1.3; box-shadow: 0 2px 6px rgba(30,30,25,.05); }
.time-event strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-event span { color: var(--muted); }
.time-event.large { padding: 9px; font-size: 10px; }
.time-event.compact { padding-top: 3px; padding-bottom: 3px; }
.time-event.dimmed { opacity: .25; filter: saturate(.5); }
.event-badge { position: absolute; top: 3px; right: 4px; padding: 1px 4px; border-radius: 99px; background: var(--event-color); color: white !important; font-size: 8px; }
.now-line { position: absolute; left: 0; right: 0; z-index: 3; border-top: 1px solid var(--danger); pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -3px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }

.settings-section { height: 100%; overflow: hidden; padding: 0; background: #f7f6f2; }
.settings-shell { height: 100%; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.settings-nav { min-height: 0; display: flex; flex-direction: column; padding: 34px 18px 22px; border-right: 1px solid var(--line); background: #eeece6; }
.settings-nav-head { padding: 0 12px 28px; }
.settings-nav-head h1 { margin: 0; font-size: 30px; font-weight: 780; letter-spacing: -.04em; }
.settings-nav nav { display: grid; gap: 6px; }
.settings-nav-item { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid transparent; border-radius: 13px; background: transparent; text-align: left; cursor: pointer; }
.settings-nav-item:hover { background: rgba(255,255,255,.55); }
.settings-nav-item.active { border-color: var(--line); background: var(--card); box-shadow: 0 8px 22px rgba(45,43,38,.06); }
.settings-nav-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: #dedbd2; font-size: 12px; font-weight: 850; }
.settings-nav-item.active .settings-nav-icon { background: var(--ink); color: #fff; }
.settings-nav-item strong, .settings-nav-item small { display: block; }
.settings-nav-item strong { font-size: 12px; }
.settings-nav-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.settings-nav-item b { color: #a5a59e; font-size: 18px; }
.settings-nav-item b, .settings-nav-item b .ui-icon { display: grid; width: 15px; height: 15px; place-items: center; }
.settings-nav-note { margin: auto 12px 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.settings-content { min-height: 0; overflow-y: auto; padding: 42px clamp(28px, 5vw, 78px) 80px; }
.settings-page { display: none; width: min(900px, 100%); margin: 0 auto; }
.settings-page.active { display: block; }
.settings-page-head { margin-bottom: 29px; }
.settings-page-head h2 { margin: 0; font-size: clamp(29px, 4vw, 42px); font-weight: 760; letter-spacing: -.045em; }
.settings-page-head > p:last-child { max-width: 620px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.profile-panel { display: flex; align-items: center; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); }
.profile-avatar { display: grid; width: 58px; height: 58px; flex: 0 0 58px; place-items: center; border-radius: 17px; background: var(--ink); color: #fff; font-size: 22px; font-weight: 800; }
.profile-panel h3 { margin: 0; font-size: 18px; }
.profile-panel p { margin: 4px 0 8px; color: var(--muted); font-size: 11px; }
.verified-label { padding: 4px 8px; border-radius: 99px; background: #e4eee8; color: var(--green); font-size: 8px; font-weight: 800; }
.settings-list { margin-top: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); overflow: hidden; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 21px; }
.settings-row strong { font-size: 12px; }
.settings-row p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.danger-zone { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-top: 34px; padding: 22px; border: 1px solid #e4b9b4; border-radius: 15px; background: #fff9f8; }
.danger-zone h3 { margin: 0; font-size: 15px; }
.danger-zone p:last-child { max-width: 580px; margin: 8px 0 0; color: #7d6461; font-size: 10px; line-height: 1.65; }
.danger-button { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 1px solid var(--danger); border-radius: 10px; background: transparent; color: var(--danger); cursor: pointer; font-size: 10px; font-weight: 800; }
.ai-method-list { display: grid; gap: 9px; }
.ai-method-card { position: relative; display: grid; grid-template-columns: 44px 1fr auto 22px; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; cursor: pointer; }
.ai-method-card:hover { border-color: #bcbab2; }
.ai-method-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(68,83,216,.08); }
.ai-method-card.disabled { cursor: default; opacity: .62; }
.method-logo { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; font-weight: 850; }
.google-logo { background: #eef0ff; color: var(--accent); }
.key-logo { background: #e4f0eb; color: var(--green); font-size: 22px; }
.credit-logo { background: #eee9df; color: #876b38; }
.method-copy strong, .method-copy small { display: block; }
.method-copy strong { font-size: 12px; }
.method-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.method-check { display: none; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-size: 10px; }
.ai-method-card.selected .method-check { display: grid; }
.state-badge { padding: 5px 9px; border-radius: 99px; background: var(--paper-2); color: var(--muted); font-size: 9px; font-weight: 800; }
.state-badge.ready { background: #dcefe7; color: var(--green); }
.state-badge.error { background: #f6e1df; color: var(--danger); }
.state-badge.provisioning { background: var(--accent-soft); color: var(--accent-dark); }
.account-model-hub { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 20px; padding: 26px; border: 1px solid #c9cceb; border-radius: 18px; background: linear-gradient(135deg, #fff, #f2f3ff); box-shadow: 0 12px 38px rgba(68,83,216,.08); }
.account-model-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 17px; background: var(--ink); color: #fff; }
.account-model-icon .ui-icon { width: 27px; height: 27px; }
.account-model-copy > p { max-width: 690px; margin: 10px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.account-model-features { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.account-model-features span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.7); color: #555850; font-size: 9px; font-weight: 750; }
.account-model-features .ui-icon { width: 14px; height: 14px; }
.account-ai-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-ai-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.account-ai-overview article { display: grid; gap: 5px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.account-ai-overview span { color: var(--muted); font-size: 9px; font-weight: 750; }
.account-ai-overview strong { font-size: 21px; letter-spacing: -.03em; }
.account-model-selection { margin-top: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.account-model-selection h3 { margin: 0; font-size: 17px; }
.account-model-selection > div:first-child > p:last-child { margin: 7px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.account-model-list { display: grid; gap: 7px; margin-top: 14px; }
.account-model-item { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.account-model-item strong, .account-model-item small { display: block; }
.account-model-item strong { font-size: 11px; }
.account-model-item small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.integration-note.error { border-color: #e4b9b4; background: #fff4f2; color: #7d6461; }
.integration-note a { color: var(--accent-dark); font-weight: 750; }

.integration-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #f4f2ec; color: var(--muted); }
.integration-note > .ui-icon { margin-top: 1px; width: 17px; height: 17px; }
.integration-note p { margin: 0; font-size: 10px; line-height: 1.65; }
.integration-note strong { color: var(--ink); }
.method-detail-panel, .model-picker-panel, .calendar-setting-panel { margin-top: 16px; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.method-detail-panel > p, .model-picker-panel p { margin: 8px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.detail-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.detail-title h3, .model-picker-panel h3 { margin: 0; font-size: 16px; }
.subtle-status { color: var(--muted); font-size: 9px; font-weight: 800; }
.connection-detail { padding: 11px; border-radius: 10px; background: var(--paper); color: var(--muted); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.model-picker-panel { display: grid; grid-template-columns: 1fr minmax(220px, 340px); align-items: end; gap: 24px; }
.settings-page label, .modal label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.settings-page input, .settings-page select, .modal input, .modal select, .modal textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}
.settings-page select:focus, .modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(68,83,216,.1); }
.api-connection-list { display: grid; gap: 8px; margin-top: 14px; }
.api-connection-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.api-connection-item.selected { border-color: var(--accent); background: #f7f7ff; }
.api-connection-item strong, .api-connection-item small { display: block; }
.api-connection-item strong { font-size: 11px; }
.api-connection-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.api-empty { padding: 17px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: 10px; text-align: center; }
.settings-savebar { position: sticky; bottom: -1px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,250,.9); backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(50,48,42,.09); }
.settings-savebar span { color: var(--muted); font-size: 9px; }
.calendar-setting-panel { max-width: 620px; }
.inline-savebar { position: static; max-width: 620px; box-shadow: none; }
.view-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 18px; }
.view-preview span { display: grid; min-height: 60px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--muted); font-size: 10px; }
.calendar-sync-section { margin-top: 38px; padding-top: 34px; border-top: 1px solid var(--line); }
.calendar-sync-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.calendar-sync-heading h3 { margin: 0; font-size: 20px; }
.calendar-sync-heading p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.calendar-sync-list { display: grid; gap: 11px; }
.calendar-provider-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.calendar-provider-card > header { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 13px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.provider-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; background: var(--paper-2); color: var(--accent-dark); }
.calendar-provider-card header strong, .calendar-provider-card header small { display: block; }
.calendar-provider-card header strong { font-size: 12px; }
.calendar-provider-card header small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.sync-enable { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 7px !important; white-space: nowrap; }
.sync-enable input { width: 17px; min-height: 17px; accent-color: var(--accent); }
.sync-scope-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 11px; padding: 16px 17px 17px; }
.sync-save-button { min-height: 42px; grid-column: 1 / -1; justify-self: end; }
.sync-save-button .ui-icon { width: 15px; height: 15px; }

.agent-panel { grid-row: 2; grid-column: 3; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; border-left: 1px solid var(--line); }
.agent-head { display: flex; align-items: center; gap: 11px; padding: 20px 17px 13px; }
.agent-head h2 { margin: 0; font-family: var(--font-sans); font-size: 17px; font-weight: 750; }
.agent-credit-badge { margin-left: auto; padding: 5px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 8px; font-weight: 750; white-space: nowrap; }
.agent-avatar { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: var(--ink); color: white; }
.agent-avatar .ui-icon { width: 19px; height: 19px; }
.agent-context { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 16px 8px; padding: 7px 8px 7px 10px; border-radius: 8px; background: rgba(255,255,255,.48); color: var(--muted); font-size: 9px; }
.agent-context > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-context select { max-width: 132px; min-width: 0; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); font-size: 8px; }
.agent-unavailable .agent-context { background: var(--paper); }
.agent-unavailable .chat-form { opacity: .55; }
.agent-unavailable .send-button { cursor: not-allowed; }
.agent-group-required { display: grid; align-content: center; justify-items: center; min-height: 100%; padding: 28px 20px; color: var(--muted); text-align: center; }
.agent-group-required .ui-icon { width: 28px; height: 28px; margin-bottom: 12px; color: var(--accent); }
.agent-group-required strong { color: var(--ink); font-size: 12px; }
.agent-group-required p { max-width: 240px; margin: 8px 0 0; font-size: 9px; line-height: 1.65; }
.chat-list { min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 12px 16px; }
.message { display: flex; }
.message.user { justify-content: flex-end; }
.message-stack { display: grid; max-width: 92%; gap: 7px; }
.message-stack .message-body { max-width: 100%; }
.message-body { max-width: 88%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; background: var(--card); font-size: 11px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-body { border-color: var(--ink); border-radius: 14px 4px 14px 14px; background: var(--ink); color: #fff; }
.message.pending .message-body { color: var(--muted); animation: pulse 1s infinite alternate; }
.message.pending .agent-progress { display: grid; grid-template-columns: 18px 1fr; align-items: start; gap: 9px; min-width: min(280px, 88%); animation: none; }
.agent-progress-spinner { width: 16px; height: 16px; margin-top: 2px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.agent-progress strong, .agent-progress small, .agent-progress em { display: block; }
.agent-progress strong { color: var(--ink); font-size: 10px; }
.agent-progress small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.agent-progress em { margin-top: 5px; color: var(--accent-dark); font-size: 7px; font-style: normal; font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }
.proposal-card { padding: 11px; border: 1px solid #bfc4f1; border-radius: 11px; background: #f6f7ff; }
.proposal-label { display: block; margin-bottom: 6px; color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.proposal-card strong { display: block; font-size: 10px; }
.proposal-card p { margin: 5px 0 9px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.proposal-card > div { display: flex; justify-content: flex-end; gap: 6px; }
@keyframes pulse { to { opacity: .45; } }
.quota-card { margin: 8px 14px; padding: 13px; border: 1px solid #e1b7b2; border-radius: 12px; background: #fff5f3; }
.quota-card strong { font-size: 12px; }
.quota-card p { margin: 6px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.quota-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.chat-form { position: relative; display: grid; grid-template-columns: 35px 1fr 36px; align-items: end; gap: 7px; margin: 9px 14px 4px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.chat-form textarea { width: 100%; max-height: 120px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; line-height: 1.5; }
.send-button { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; background: var(--accent); color: white; font-size: 19px; }
.prompt-template-button { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); cursor: pointer; }
.prompt-template-button[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.prompt-template-menu { position: absolute; z-index: 25; right: 0; bottom: calc(100% + 8px); left: 0; max-height: min(440px, 65dvh); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.prompt-template-menu > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 9px; border-bottom: 1px solid var(--line); }
.prompt-template-menu > header strong, .prompt-template-menu > header small { display: block; }
.prompt-template-menu > header strong { font-size: 11px; }
.prompt-template-menu > header small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.prompt-template-menu > div { display: grid; gap: 3px; max-height: min(360px, 52dvh); overflow-y: auto; padding: 7px; }
.prompt-template-item { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; width: 100%; padding: 9px; border-radius: 9px; color: var(--ink); text-align: left; cursor: pointer; }
.prompt-template-item:hover, .prompt-template-item:focus-visible { background: var(--paper); outline: none; }
.prompt-template-item > .ui-icon { width: 17px; height: 17px; padding: 5px; box-sizing: content-box; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); }
.prompt-template-item strong, .prompt-template-item small { display: block; }
.prompt-template-item strong { font-size: 9px; }
.prompt-template-item small { margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.agent-disclaimer { margin: 4px 15px 11px; color: var(--muted); font-size: 8px; text-align: center; }

.drawer-backdrop { display: none; }
.modal { width: min(620px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(25,25,22,.38); backdrop-filter: blur(3px); }
.modal > form, .modal > div:not(.modal-head) { padding: 24px; }
.modal form { display: grid; gap: 15px; padding: 24px; }
.small-modal { width: min(460px, calc(100vw - 24px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-family: var(--font-sans); font-size: 23px; font-weight: 760; }
.modal-description { margin: -2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.task-detail-modal { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
.task-detail-modal > form { width: min(820px, 100%); min-height: 100%; margin: 0 auto; align-content: start; overflow-y: auto; padding: clamp(24px, 5vw, 58px); }
.task-detail-modal .modal-actions { grid-template-columns: auto auto 1fr auto auto; position: sticky; bottom: 0; padding: 13px 0 calc(13px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--card) 28%); }
.task-add-note { display: flex; align-items: center; gap: 9px; margin: 0; padding: 11px 13px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; line-height: 1.55; }
.task-add-note .ui-icon { width: 16px; height: 16px; }
.group-planner-modal { width: min(760px, calc(100vw - 24px)); max-height: min(880px, calc(100dvh - 24px)); }
.group-planner-modal > form { max-height: min(880px, calc(100dvh - 24px)); overflow-y: auto; }
.group-ai-note { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 14px; border: 1px solid #c8ccef; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; line-height: 1.65; }
.group-ai-note .ui-icon { margin-top: 1px; }
.group-ai-note strong { display: block; margin-bottom: 2px; }
.question-card { display: grid; width: 100%; grid-template-columns: 22px 1fr; align-items: start; gap: 8px; padding: 10px; border: 1px solid #bfc4f1; border-radius: 11px; background: #f6f7ff; color: var(--accent-dark); text-align: left; cursor: pointer; }
.question-card strong, .question-card small { display: block; }
.question-card strong { font-size: 9px; }
.question-card small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.question-modal { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.proposal-modal { width: min(1040px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.question-modal > form, .proposal-modal > form { max-height: calc(100dvh - 24px); overflow-y: auto; }
.batch-question-list, .proposal-change-list { display: grid; gap: 12px; }
.batch-question { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.batch-question p { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.65; }
.question-answer-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.question-answer-modes button { min-height: 42px; padding-inline: 8px; }
.question-answer-modes button.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.batch-question textarea[hidden] { display: none; }
.question-actions { grid-template-columns: auto 1fr auto; }
.proposal-change { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.proposal-change strong { font-size: 11px; }
.proposal-change small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.proposal-preview { display: grid; gap: 12px; }
.proposal-preview-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 15px 17px; border-radius: 13px; background: var(--ink); color: white; }
.proposal-preview-head h3 { margin: 2px 0 5px; font-size: 18px; }
.proposal-preview-head p { margin: 0; color: rgba(255,255,255,.7); font-size: 9px; }
.proposal-preview-head .eyebrow { color: rgba(255,255,255,.58); }
.proposal-preview-stats { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 5px; white-space: nowrap; }
.proposal-preview-stats strong { font-size: 18px; }
.proposal-preview-stats span { color: rgba(255,255,255,.68); font-size: 8px; }
.proposal-replace-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid #c8ccef; border-radius: 10px; background: var(--accent-soft); color: var(--accent-dark); font-size: 9px; line-height: 1.55; }
.proposal-replace-note .ui-icon { flex: 0 0 auto; margin-top: 1px; }
.proposal-quantity-summary { display: grid; gap: 7px; padding: 12px; border: 1px solid #bad8c4; border-radius: 11px; background: #f3faf5; }
.proposal-quantity-summary.invalid { border-color: #e3aaa4; background: #fff5f3; }
.proposal-quantity-summary > header { display: grid; gap: 3px; }
.proposal-quantity-summary > header strong { font-size: 11px; }
.proposal-quantity-summary > header span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.proposal-quantity-row { display: grid; grid-template-columns: minmax(80px, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 8px 9px; border-radius: 8px; background: rgba(255,255,255,.7); font-size: 9px; }
.proposal-quantity-row strong { font-size: 10px; }
.proposal-quantity-row span { color: var(--muted); }
.proposal-quantity-row em { min-width: 42px; color: #287342; font-style: normal; font-weight: 800; text-align: right; }
.proposal-quantity-row.mismatched em { color: #ad392f; }
.proposal-planner-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.proposal-planner-stats span { display: grid; gap: 2px; padding: 8px 9px; border-radius: 8px; background: rgba(255,255,255,.75); color: var(--muted); font-size: 8px; }
.proposal-planner-stats strong { color: var(--ink); font-size: 12px; }
.proposal-planner-advice { display: grid; gap: 4px; padding: 9px; border-radius: 8px; background: rgba(255,255,255,.72); }
.proposal-planner-advice strong { font-size: 9px; }
.proposal-planner-advice ul { display: grid; gap: 3px; margin: 0; padding-left: 18px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.proposal-change-summary { display: grid; gap: 7px; padding: 12px; border: 1px solid #b9c5f7; border-radius: 11px; background: #f5f7ff; }
.proposal-change-summary > header { display: grid; gap: 3px; }
.proposal-change-summary > header strong { font-size: 11px; }
.proposal-change-summary > header span { color: var(--muted); font-size: 9px; }
.proposal-change-diff { display: grid; grid-template-columns: minmax(100px,.7fr) minmax(220px,1.7fr) auto; gap: 10px; align-items: center; padding: 9px; border-radius: 8px; background: rgba(255,255,255,.8); font-size: 9px; }
.proposal-change-diff span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.proposal-change-diff del { color: var(--muted); }
.proposal-change-diff ins { color: var(--ink); font-weight: 800; text-decoration: none; }
.proposal-change-diff em { color: var(--accent-dark); font-style: normal; }
.proposal-weekdays, .proposal-day-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.proposal-weekdays { padding: 0 4px; color: var(--muted); font-size: 8px; font-weight: 750; text-align: center; }
.proposal-weekdays span:first-child { color: #b25c52; }
.proposal-weekdays span:last-child { color: var(--accent); }
.proposal-day-card { min-width: 0; min-height: 128px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.proposal-day-card > header { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 8px 9px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.55); }
.proposal-day-card > header span { min-width: 0; overflow: hidden; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.proposal-day-card > header small { flex: 0 0 auto; color: var(--muted); font-size: 7px; }
.proposal-day-card > div { display: grid; gap: 5px; padding: 7px; }
.proposal-preview-event { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 5px; padding: 6px; border-left: 3px solid var(--accent); border-radius: 6px; background: var(--card); }
.proposal-preview-event span { color: var(--muted); font-size: 7px; }
.proposal-preview-event strong { min-width: 0; overflow: hidden; font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.proposal-preview-event em { grid-column: 2; color: var(--accent-dark); font-size: 7px; font-style: normal; }
.proposal-decision-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.proposal-decision-buttons button { min-height: 48px; }
.proposal-feedback-button { width: 100%; }
.delete-group-options { display: grid; gap: 9px; }
.delete-group-option { display: grid !important; grid-template-columns: auto 1fr; align-items: start; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; }
.delete-group-option.selected { border-color: var(--danger); background: #fff5f3; }
.delete-group-option input { width: 17px; min-height: 17px; margin-top: 2px; accent-color: var(--danger); }
.delete-group-option strong, .delete-group-option small { display: block; }
.delete-group-option strong { font-size: 11px; }
.delete-group-option small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.delete-group-modal .danger-button { background: var(--danger); color: white; }
.planner-questions { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.planner-questions h3 { margin: 0; font-size: 14px; }
.planner-questions > div:first-child > p:last-child { margin: 6px 0 15px; color: var(--muted); font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.modal textarea { resize: vertical; }
.check-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.check-label input { width: 17px; min-height: 17px; }
.modal-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding-top: 5px; }
.model-candidates { display: grid; gap: 8px; margin-top: 18px; }
.model-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: calc(100vw - 32px); padding: 10px 15px; border-radius: 10px; background: var(--ink); color: white; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: .2s ease; font-size: 11px; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

@media (max-width: 1180px) {
  :root { --sidebar: 220px; --agent: 310px; }
  .view-tabs button { padding-inline: 9px; }
}

@media (max-width: 1180px), (hover: none) and (pointer: coarse) {
  :root { --topbar: 64px; }
  body { overflow-x: hidden; overflow-y: auto; }
  .app-shell { grid-template-columns: 1fr; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .brand-wrap { padding: 0 10px; }
  .app-brand { font-size: 21px; }
  .view-tabs { justify-content: flex-start; overflow-x: auto; padding: 0 4px; scrollbar-width: none; }
  .view-tabs::-webkit-scrollbar { display: none; }
  .top-actions { padding-right: 8px; gap: 5px; }
  #today-button { display: none; }
  .sidebar, .agent-panel { position: fixed; z-index: 40; top: var(--topbar); bottom: 0; width: min(88vw, 350px); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar { left: 0; transform: translateX(-105%); }
  .sidebar.open { transform: translateX(0); }
  .agent-panel { right: 0; transform: translateX(105%); }
  .agent-panel.open { transform: translateX(0); }
  .calendar-main { grid-column: 1; }
  .drawer-backdrop { position: fixed; z-index: 35; inset: var(--topbar) 0 0; border: 0; background: rgba(30,30,27,.3); }
  .drawer-backdrop.show { display: block; }
  .settings-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .settings-content { padding: 32px 28px 70px; }
  .calendar-toolbar { padding: 13px 10px; }
  .active-group-summary { display: none; }
  .date-navigation h1 { min-width: 0; font-size: 21px; }
  .top-actions #new-task-button { width: 38px; padding: 0; }
  .top-actions #new-task-button > span { display: none; }
  .inline-help-button { display: none; }
  .welcome {
    grid-template-columns: 1fr;
    align-content: start;
    padding-bottom: calc(128px + env(safe-area-inset-bottom));
  }
  .welcome-mark { min-height: 34vh; }
  .welcome-mark::before { inset: 10% 22%; }
  .welcome-mark span { height: 20%; left: 23%; right: 18%; }
  .welcome-mark span:nth-child(1) { top: 10%; }
  .welcome-mark span:nth-child(2) { top: 40%; left: 32%; }
  .welcome-mark span:nth-child(3) { top: 70%; left: 40%; }
  .welcome-card { padding: 26px 0 40px; }
  .welcome-card h1 { font-size: 39px; }
}

@media (max-width: 720px) {
  .settings-section { overflow-y: auto; }
  .settings-shell { height: auto; min-height: 100%; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { position: sticky; z-index: 8; top: 0; display: block; padding: 16px 12px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-nav-head { display: none; }
  .settings-nav nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .settings-nav-item { display: flex; justify-content: center; padding: 9px 6px; text-align: center; }
  .settings-nav-item .settings-nav-icon, .settings-nav-item small, .settings-nav-item b { display: none; }
  .settings-nav-item strong { font-size: 10px; white-space: nowrap; }
  .settings-nav-note { display: none; }
  .settings-content { overflow: visible; padding: 25px 15px 90px; }
  .settings-page-head { margin-bottom: 21px; }
  .settings-page-head h2 { font-size: 29px; }
  .settings-row, .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-button { width: 100%; }
  .ai-method-card { grid-template-columns: 39px 1fr auto; gap: 10px; padding: 13px; }
  .ai-method-card .state-badge { grid-column: 2; justify-self: start; }
  .method-check { position: absolute; top: 12px; right: 12px; }
  .model-picker-panel { grid-template-columns: 1fr; }
  .settings-savebar { bottom: calc(8px + env(safe-area-inset-bottom)); }
  .settings-savebar span { display: none; }
  .settings-savebar .primary-button { width: 100%; }
  .account-model-hub { grid-template-columns: 1fr; padding: 20px; }
  .account-ai-overview { grid-template-columns: 1fr; }
  .account-model-selection { padding: 18px; }
  .account-model-item { grid-template-columns: 36px 1fr; }
  .account-model-item > .state-badge { grid-column: 2; justify-self: start; }
  .account-ai-actions > * { width: 100%; }

  .calendar-provider-card > header { grid-template-columns: 40px 1fr; }
  .sync-enable { grid-column: 1 / -1; }
  .sync-scope-grid { grid-template-columns: 1fr; }
  .sync-save-button { width: 100%; }
  .proposal-preview-head { align-items: flex-start; }
  .proposal-weekdays { display: none; }
  .proposal-day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proposal-day-card { grid-column: auto !important; min-height: 112px; }
}

@media (max-width: 560px) {
  .brand-glyph { display: none; }
  .view-tabs button { padding: 8px 7px; font-size: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-actions { grid-template-columns: auto 1fr auto; }
  .modal-actions .modal-close { display: none; }
  .task-detail-modal .modal-actions { display: flex; flex-wrap: wrap; }
  .task-detail-modal .modal-actions > span { flex: 1; }
  .task-detail-modal .modal-actions .primary-button { flex: 0 0 100%; order: 5; }
  .group-planner-modal { width: 100vw; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .group-planner-modal > form { max-height: 100dvh; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .proposal-preview-head { display: grid; }
  .proposal-day-grid { grid-template-columns: 1fr; }
  .proposal-quantity-row { grid-template-columns: 1fr 1fr; gap: 4px 10px; }
  .proposal-quantity-row em { text-align: left; }
  .proposal-planner-stats { grid-template-columns: 1fr; }
  .proposal-change-diff { grid-template-columns: 1fr; }
  .proposal-change-diff span { flex-wrap: wrap; }
  .welcome-card {
    width: calc(100% - 32px);
  }
  .welcome-copy {
    margin-block: 22px;
  }
  .login-button {
    width: 100%;
    min-height: 50px;
  }
}
