:root {
  --ink: #161715;
  --muted: #74756f;
  --paper: #f7f7f4;
  --surface: #ffffff;
  --line: #dedfd9;
  --line-strong: #b9bbb4;
  --mint: #d9eee4;
  --mint-strong: #9bcbb4;
  --blue: #dce8f2;
  --peach: #f2dfd4;
  --gray: #e8e8e4;
  --hour-height: 64px;
  --day-width: 164px;
  --header-height: 58px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.app-shell { height: 100%; display: grid; grid-template-rows: 70px minmax(0, 1fr); }
.topbar { display: grid; grid-template-columns: 230px minmax(300px, 1fr) auto; align-items: center; border-bottom: 1px solid var(--ink); background: var(--surface); padding: 0 22px; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: 0; width: fit-content; }
.brand small, .auth-brand small { display: block; color: var(--muted); font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: white; border-radius: 50%; font-family: Georgia, serif; font-weight: 400; }
.brand-mark.large { width: 44px; height: 44px; font-size: 21px; }
.date-navigation, .topbar-actions { display: flex; align-items: center; }
.date-navigation { gap: 6px; justify-self: start; }
.date-navigation strong { font-size: 14px; margin-left: 12px; white-space: nowrap; }
.topbar-actions { gap: 10px; justify-content: flex-end; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 4px; }
.icon-button:hover { background: #f0f0ed; border-color: var(--line-strong); }
.icon-button.small { width: 28px; height: 28px; border: 0; }
.icon-button svg, .primary-button svg, .secondary-button svg, .danger-button svg, .logout-button svg, .toolbar-meta svg, .search-box svg, .sidebar-footer svg { width: 16px; height: 16px; stroke-width: 1.8; }
.today-button, .secondary-button { height: 36px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-weight: 650; }
.today-button:hover, .secondary-button:hover { border-color: var(--ink); }
.primary-button { min-height: 38px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--ink); color: white; border: 1px solid var(--ink); border-radius: 4px; font-weight: 650; }
.primary-button:hover { background: #353632; }
.search-box { height: 38px; width: 214px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.search-box:focus-within { border-color: var(--ink); background: white; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; }
.search-box kbd { padding: 2px 4px; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--muted); font: 10px ui-monospace, monospace; white-space: nowrap; }
.profile-button { min-width: 170px; height: 46px; display: grid; grid-template-columns: 32px 1fr 16px; align-items: center; gap: 9px; padding: 4px 2px 4px 6px; background: transparent; text-align: left; }
.profile-button > span:first-child, .profile-identity > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--mint); border: 1px solid var(--ink); font-weight: 750; }
.profile-label { min-width: 0; display: flex; flex-direction: column; }
.profile-label strong, .profile-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-label strong { font-size: 12px; }.profile-label small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.profile-button > svg { width: 14px; }
.workspace { min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 22px 18px 16px; border-right: 1px solid var(--ink); background: var(--surface); }
.section-heading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-heading strong { font-size: 12px; }.section-heading > span { color: var(--muted); font-size: 10px; }
.weekdays, .month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.weekdays { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.month-grid button, .month-grid span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: transparent; font-size: 10px; }
.month-grid button:hover { background: var(--gray); }
.month-grid button.today { background: var(--ink); color: white; }
.month-grid button.in-range:not(.today) { border: 1px solid var(--line); }
.month-grid .outside { color: #c7c8c2; }
.today-summary, .categories { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.summary-grid > div { display: flex; flex-direction: column; border-left: 2px solid var(--ink); padding-left: 9px; }
.summary-grid strong { font: 600 21px/1.1 Georgia, serif; }.summary-grid span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.progress-track { height: 4px; margin-top: 16px; overflow: hidden; background: var(--gray); }
.progress-track span { display: block; height: 100%; width: 0; background: var(--mint-strong); transition: width .3s ease; }
.today-summary p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.category-filter { width: 100%; height: 34px; display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; padding: 0 7px; background: transparent; border-radius: 4px; text-align: left; font-size: 11px; }
.category-filter:hover, .category-filter.active { background: var(--paper); }
.category-filter.active { font-weight: 650; }
.category-filter em { color: var(--muted); font-style: normal; font-size: 9px; }
.category-dot { width: 8px; height: 8px; border: 1px solid var(--ink); border-radius: 50%; }.category-dot.all { background: var(--ink); }.category-dot.focus { background: var(--mint-strong); }.category-dot.meeting { background: #9dbbd2; }.category-dot.personal { background: #d7a98f; }.category-dot.rest { background: #c3c4bd; }
.sidebar-footer { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 18px; color: var(--muted); font-size: 10px; }
.planner { min-width: 0; min-height: 0; display: grid; grid-template-rows: 84px minmax(0, 1fr); background: var(--paper); }
.planner-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 13px 24px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.planner-toolbar h1, .modal h2, .profile-drawer h2 { margin: 4px 0 0; font: 600 24px/1.1 Georgia, "Songti SC", serif; letter-spacing: 0; }
.toolbar-meta { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 10px; }
.toolbar-meta span { display: flex; align-items: center; gap: 6px; }.toolbar-meta b { color: inherit; font-weight: 500; }
.planner-scroll { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; background: white; scrollbar-color: #aaa transparent; scrollbar-width: thin; }
.timeline-layout { width: max-content; min-width: 100%; display: flex; align-items: flex-start; }
.time-column { width: 62px; flex: 0 0 62px; position: sticky; left: 0; z-index: 8; background: var(--surface); border-right: 1px solid var(--ink); }
.time-zone { height: var(--header-height); display: grid; place-items: center; position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--ink); color: var(--muted); font: 8px ui-monospace, monospace; }
.time-body { height: calc(var(--hour-height) * 24); position: relative; }
.time-label { position: absolute; right: 9px; transform: translateY(-50%); color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.time-label:first-child { transform: none; top: 5px !important; }
.days-stage { min-width: calc(var(--day-width) * 30); }
.days-header, .days-body { display: flex; width: calc(var(--day-width) * 30); }
.days-header { height: var(--header-height); position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--ink); }
.day-head { width: var(--day-width); flex: 0 0 var(--day-width); display: flex; align-items: center; gap: 9px; padding: 0 12px; border-right: 1px solid var(--line); }
.day-head .date-number { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 50%; font: 600 16px Georgia, serif; }
.day-head.today .date-number { background: var(--ink); color: white; }
.day-head span:last-child { display: flex; flex-direction: column; font-size: 10px; }.day-head small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.day-column { width: var(--day-width); height: calc(var(--hour-height) * 24); flex: 0 0 var(--day-width); position: relative; border-right: 1px solid var(--line); background-color: white; background-image: linear-gradient(to bottom, transparent calc(25% - 1px), #f0f0ec calc(25% - 1px), #f0f0ec 25%, transparent 25%), linear-gradient(to bottom, transparent calc(100% - 1px), var(--line) calc(100% - 1px)); background-size: 100% var(--hour-height), 100% var(--hour-height); }
.day-column.today { background-color: #fbfdfb; }
.day-column.weekend:not(.today) { background-color: #fafaf8; }
.day-column:hover { background-color: #f9fbf9; }
.current-time { position: absolute; left: -4px; right: 0; height: 1px; background: #df5b4f; z-index: 4; pointer-events: none; }
.current-time::before { content: ""; position: absolute; left: 0; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: #df5b4f; }
.event-card { position: absolute; left: 5px; right: 5px; min-height: 24px; padding: 6px 7px; overflow: hidden; border: 1px solid var(--ink); border-left-width: 3px; border-radius: 3px; background: var(--mint); text-align: left; z-index: 3; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
.event-card:hover { transform: translateY(-1px); box-shadow: 2px 3px 0 rgba(22,23,21,.16); z-index: 5; }
.event-card.meeting { background: var(--blue); }.event-card.personal { background: var(--peach); }.event-card.rest { background: var(--gray); }
.event-card.done { opacity: .55; }.event-card.done strong { text-decoration: line-through; }
.event-card.filtered { opacity: .08; pointer-events: none; }
.event-card strong, .event-card small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.event-card strong { font-size: 10px; line-height: 1.2; }.event-card small { margin-top: 3px; font-size: 8px; color: #555750; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(22, 23, 21, .42); backdrop-filter: blur(2px); }
.modal { width: min(510px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; padding: 26px; background: var(--surface); border: 1px solid var(--ink); box-shadow: 8px 8px 0 rgba(22,23,21,.18); }
.modal-header, .drawer-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }.field span { font-size: 10px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 3px; background: white; font-size: 13px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.check-field { width: fit-content; display: flex; align-items: center; gap: 8px; font-size: 11px; cursor: pointer; }.check-field input { position: absolute; opacity: 0; }.check-field > span { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid var(--ink); }.check-field svg { width: 12px; opacity: 0; }.check-field input:checked + span { background: var(--ink); color: white; }.check-field input:checked + span svg { opacity: 1; }
.form-error { min-height: 16px; margin: 8px 0; color: #aa3229; font-size: 10px; }
.modal-actions { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-button { height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; background: transparent; color: #a32c24; }
.auth-backdrop { background: rgba(247,247,244,.95); }
.auth-modal { width: min(430px, 100%); padding: 34px; box-shadow: 10px 10px 0 var(--mint); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; font-weight: 750; }
.auth-modal h2 { margin-top: 8px; font-size: 30px; }.auth-modal > p { margin: 10px 0 22px; color: var(--muted); font-size: 12px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 22px; padding: 3px; border: 1px solid var(--line); background: var(--paper); }
.segmented-control button { height: 34px; background: transparent; font-size: 11px; font-weight: 650; }.segmented-control button.active { background: var(--ink); color: white; }
.auth-submit, .full-button { width: 100%; min-height: 44px; }.privacy-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; color: var(--muted); font-size: 9px; }.privacy-note svg { width: 13px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(22,23,21,.2); }
.profile-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(390px, 100vw); display: flex; flex-direction: column; padding: 26px; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--ink); transform: translateX(105%); transition: transform .25s ease; box-shadow: -10px 0 24px rgba(22,23,21,.08); }
.profile-drawer.open { transform: translateX(0); }
.profile-identity { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; padding: 16px; background: var(--paper); border: 1px solid var(--line); }
.profile-identity > span { width: 44px; height: 44px; font-size: 16px; }.profile-identity div { min-width: 0; display: flex; flex-direction: column; }.profile-identity strong, .profile-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.profile-identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.history-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.history-section .section-heading { margin-bottom: 8px; }
.history-section .section-heading > div { display: flex; flex-direction: column; gap: 4px; }
.history-section .section-heading > svg { width: 16px; color: var(--muted); }
.history-intro { margin: 0 0 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.history-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.history-stats span { display: flex; flex-direction: column; padding: 10px; border: 1px solid var(--line); background: var(--paper); }
.history-stats strong { font: 600 20px/1 Georgia, serif; }
.history-stats small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.history-section .secondary-button { background: var(--paper); }
.logout-button { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: auto; background: transparent; border: 1px solid var(--line); color: #8b302a; }
.history-modal { width: min(620px, 100%); }
.history-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.history-list { max-height: min(58vh, 540px); overflow-y: auto; }
.history-empty { display: grid; place-items: center; gap: 8px; min-height: 180px; color: var(--muted); font-size: 11px; text-align: center; }
.history-empty svg { width: 24px; height: 24px; }
.history-day { padding: 16px 0 4px; }
.history-day + .history-day { border-top: 1px solid var(--line); }
.history-day-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.history-day-heading strong { font: 600 17px/1.1 Georgia, serif; }
.history-day-heading span { color: var(--muted); font-size: 10px; }
.history-item { width: 100%; display: grid; grid-template-columns: 64px 8px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 48px; padding: 8px 0; border-top: 1px solid #f0f0ec; background: transparent; text-align: left; }
.history-item:hover { background: var(--paper); }
.history-time { color: var(--muted); font: 10px ui-monospace, monospace; }
.history-dot { width: 7px; height: 7px; border: 1px solid var(--ink); border-radius: 50%; background: var(--mint-strong); }
.history-dot.meeting { background: #9dbbd2; }.history-dot.personal { background: #d7a98f; }.history-dot.rest { background: #c3c4bd; }
.history-item-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.history-item-copy strong, .history-item-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item-copy strong { font-size: 11px; }.history-item-copy small { color: var(--muted); font-size: 9px; }
.history-status { color: var(--muted); font-size: 9px; }.history-status.done { color: #3c785c; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; display: flex; align-items: center; gap: 8px; padding: 11px 15px; background: var(--ink); color: white; border-radius: 3px; font-size: 11px; transform: translate(-50%, 90px); opacity: 0; transition: .25s ease; }.toast.show { transform: translate(-50%, 0); opacity: 1; }.toast svg { width: 15px; }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: 190px 1fr auto; }.profile-label, .profile-button > svg { display: none; }.profile-button { min-width: 38px; width: 38px; grid-template-columns: 32px; }.search-box { width: 170px; }.workspace { grid-template-columns: 200px minmax(0,1fr); }.topbar { padding-inline: 16px; }.sidebar { padding-inline: 14px; }
}

@media (max-width: 760px) {
  :root { --day-width: 148px; --hour-height: 60px; }
  .app-shell { grid-template-rows: 60px minmax(0, 1fr); }.topbar { grid-template-columns: 1fr auto; padding: 0 12px; }.date-navigation { display: none; }.topbar-actions { gap: 7px; }.search-box { display: none; }.primary-button span { display: none; }.profile-button { display: grid; }.workspace { display: block; height: 100%; }.sidebar { display: none; }.planner { height: 100%; grid-template-rows: 72px minmax(0,1fr); }.planner-toolbar { padding: 10px 14px; }.planner-toolbar h1 { font-size: 20px; }.toolbar-meta span:last-child { display: none; }.toolbar-meta { gap: 8px; }.time-column { width: 52px; flex-basis: 52px; }.day-head { padding: 0 8px; gap: 7px; }.modal { padding: 20px; }.auth-modal { padding: 25px; }.form-row { gap: 8px; }.modal-actions { grid-template-columns: auto 1fr auto; }.modal-actions .secondary-button { display: none; }.modal-actions .primary-button { grid-column: 3; }.danger-button { padding: 0; }.event-card { left: 3px; right: 3px; }.toast { bottom: 14px; }
}

@media (max-width: 430px) {
  .toolbar-meta { display: none; }.form-row { grid-template-columns: 1fr; }.field { margin-bottom: 12px; }.modal { max-height: calc(100vh - 20px); }.modal-backdrop { padding: 10px; }.auth-modal h2 { font-size: 27px; }
  .history-item { grid-template-columns: 54px 8px minmax(0, 1fr); }.history-status { display: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; } }
