:root {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #25313a;
  background: #f4f4f1;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid #25313a; outline-offset: 2px; }
.page { max-width: 1180px; margin: auto; padding: 32px 24px 48px; }
.header { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; letter-spacing: .1em; font-weight: 700; color: #68737b; margin: 0 0 4px; }
h1 { font-size: 28px; line-height: 1.25; margin: 0; letter-spacing: -.04em; }
h2 { font-size: 18px; margin: 0; }
.actions { display: flex; align-items: center; gap: 8px; }
.actions button, #auth-form button { min-height: 44px; padding: 0 14px; border-radius: 12px; background: #ffffff; border: 1px solid #e4e8e8; color: inherit; font-weight: 650; }
.actions button:hover, .actions button:focus-visible { background: #e9ecee; }
.actions button:disabled { opacity: .55; cursor: wait; }
.actions .icon-button { width: 44px; padding: 0; font-size: 26px; line-height: 1; }
.actions #refresh, #auth-form button { background: #25313a; color: #ffffff; }
.message { min-height: 20px; margin: 16px 0 12px; color: #68737b; font-size: 14px; }
.message.error { color: #a33a42; }
.calendar { background: #ffffff; border: 1px solid #e4e8e8; border-radius: 18px; overflow: hidden; box-shadow: 0 12px 32px rgba(37,49,58,.06); }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.weekdays { background: #f4f4f1; border-bottom: 1px solid #e4e8e8; }
.weekdays span { text-align: center; padding: 12px 0; font-size: 13px; color: #68737b; font-weight: 700; }
.days { gap: 1px; background: #e4e8e8; }
.day { min-width: 0; min-height: 122px; padding: 7px; background: #ffffff; }
.day.other { background: #f8f9f8; }
.day.selected { background: #edf1f1; }
.date-button { border: 0; background: transparent; color: inherit; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; font-size: 18px; text-align: center; }
.other .date-button { color: #8d999e; }
.date-button[aria-current="date"] { background: #25313a; color: #ffffff; }
.date-button:hover { background: #e4e8e8; }
.date-button[aria-current="date"]:hover { background: #25313a; }
.chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chip { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 4px 5px; border-radius: 5px; font-size: 13px; color: #25313a; text-decoration: none; }
.chip:hover { text-decoration: underline; }
.chip.done .chip-title { text-decoration: line-through; }
.chip[data-category="수업·과제"] { background: #e7ddfb; }
.chip[data-category="시험·자격증"] { background: #f9d6d7; }
.chip[data-category="연구·학술제"] { background: #dbe6fa; }
.chip[data-category="지원·신청"] { background: #def0e1; }
.chip[data-category="개인"] { background: #ffedb4; }
.chip[data-category="알바"] { background: #f5e1d4; }
.chip[data-category="미분류"] { background: #e9ecee; }
.more { font-size: 13px; color: #68737b; padding-left: 4px; }
.detail { margin-top: 24px; background: #ffffff; border: 1px solid #e4e8e8; border-radius: 18px; padding: 20px; }
.detail-heading { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
#detail-count, .note, .empty { color: #68737b; font-size: 14px; }
.detail-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 0; border-top: 1px solid #e4e8e8; }
.detail-item .chip { flex: 1; min-width: 0; font-size: 16px; white-space: normal; overflow-wrap: anywhere; padding: 8px 12px; }
.detail-item small { color: #68737b; min-width: 70px; font-size: 13px; text-align: right; }
.note { margin: 18px 0 0; }
dialog { width: min(360px, calc(100% - 32px)); border: 0; border-radius: 18px; padding: 24px; color: #25313a; background: #ffffff; box-shadow: 0 16px 48px rgba(0,0,0,.15); }
dialog::backdrop { background: rgba(18,29,31,.65); }
#auth-form { display: grid; gap: 12px; }
#auth-form h2, #auth-form p { margin: 0; }
#auth-form p, #auth-form label { font-size: 14px; }
#auth-form input { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid #68737b; }
@media (max-width: 600px) {
  .page { padding: max(12px, env(safe-area-inset-top)) 12px max(32px, env(safe-area-inset-bottom)); }
  .header { align-items: start; }
  .actions { width: 100%; justify-content: space-between; }
  .actions button { padding: 0 10px; }
  .day { min-height: 90px; padding: 2px; }
  .date-button { font-size: 15px; width: 44px; margin-left: -2px; }
  .chip { font-size: 12px; padding: 3px 2px; }
  .more { font-size: 12px; padding-left: 0; }
  .detail { padding: 16px; }
}
@media (prefers-color-scheme: dark) {
  :root { color: #edf2ef; background: #141a1b; }
  .eyebrow, .message, .weekdays span, #detail-count, .note, .empty, .more, .detail-item small { color: #b9c5c2; }
  .actions button, .calendar, .detail, dialog { color: #edf2ef; background: #20292a; border-color: #374344; }
  .actions button:hover, .actions button:focus-visible { background: #3d484b; }
  .actions #refresh, #auth-form button { color: #141a1b; background: #edf2ef; }
  .weekdays, .day.other { background: #1a2324; }
  .days { background: #374344; }
  .day { background: #20292a; }
  .day.selected, .date-button:hover { background: #374344; }
  .date-button[aria-current="date"], .date-button[aria-current="date"]:hover { color: #141a1b; background: #edf2ef; }
  .other .date-button { color: #b9c5c2; }
  .chip { color: #edf2ef; }
  .chip[data-category="수업·과제"] { background: #574879; }
  .chip[data-category="시험·자격증"] { background: #753e4b; }
  .chip[data-category="연구·학술제"] { background: #354b70; }
  .chip[data-category="지원·신청"] { background: #385c4b; }
  .chip[data-category="개인"] { background: #685a31; }
  .chip[data-category="알바"] { background: #705141; }
  .chip[data-category="미분류"] { background: #3d484b; }
  .detail-item { border-color: #374344; }
  #auth-form input { color: #edf2ef; background: #141a1b; border-color: #b9c5c2; }
}

/* Self-hosted calendar: source identity, persistent login, and weekly planning. */
[hidden] { display: none !important; }
:root { background:#f6f5fa; }
button, input, select { font:inherit; }
button { min-height:44px; border:1px solid #dedbe5; border-radius:10px; padding:8px 12px; background:white; color:inherit; }
.app-shell { display:grid; grid-template-columns:220px minmax(0,1fr); min-height:100vh; }
.app-shell.sidebar-collapsed { grid-template-columns:minmax(0,1fr); }
.header-title { display:flex; gap:16px; align-items:center; flex-wrap:wrap; }
#toggle-sidebar { font-size:13px; white-space:nowrap; }
.sidebar { background:#fff; padding:32px 20px; border-right:1px solid #e4e0ec; display:flex; flex-direction:column; gap:12px; }
.brand { color:#42305e; font-size:21px; font-weight:750; text-decoration:none; }
.sidebar-caption { color:#7a7387; font-size:12px; line-height:1.6; }
.view-buttons { display:grid; gap:8px; margin:16px 0 0; }
.view-buttons button,.plain-button { text-align:left; border:0; background:transparent; }
.view-buttons [aria-pressed=true] { background:#eee7fb; color:#5c3f92; font-weight:700; }
.source-filters { border-top:1px solid #ece8f0; padding-top:20px; margin-top:12px; display:grid; gap:16px; }
.source-filters h2 { font-size:15px; }.source-filters label { display:flex; gap:8px; align-items:center; font-size:14px; }
.dot { width:9px; height:9px; display:inline-block; border-radius:50%; }.notion { background:#a17ada; }.google { background:#4e94e6; }.plan { background:#7f9f64; }
.page { width:100%; max-width:1600px; margin:0; align-self:start; padding:32px; }
.policy { max-width:760px; margin:32px auto; padding:24px; line-height:1.8; }.policy h1 { margin:24px 0; }.policy h2 { margin:28px 0 8px; }.policy a { color:#70539b; }
.calendar-layout { display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:20px; align-items:start; }
.detail { margin:0; padding:18px; }.detail-item { display:block; }.detail-item small { display:block; text-align:left; margin:6px 0; }
.detail-item .chip { display:block; width:100%; text-align:left; border:0; }.detail #add-plan { width:100%; margin-top:16px; }
.chip[data-source=notion] { background:#eee5fb; border-left:3px solid #a17ada; }
.chip[data-source=google] { background:#e3efff; border-left:3px solid #4e94e6; }
.chip[data-source=plan] { background:#edf3e5; border-left:3px solid #7f9f64; }
button.chip { min-height:0; text-align:left; font-weight:400; width:100%; }
.sync-status { display:flex; gap:8px; flex-wrap:wrap; margin-top:20px; }.sync-status span { border:1px solid #e4e0ec; border-radius:20px; padding:5px 10px; font-size:12px; background:#fff; }
.primary,#auth-form .primary { background:#7760aa; color:white; border:0; font-weight:650; }
.error { color:#a33a42; }.wide-dialog { width:min(650px,calc(100% - 24px)); }
dialog { max-height:90vh; overflow:auto; }dialog input:not([type=checkbox]),dialog select { min-height:44px; width:100%; border:1px solid #ccc5d5; border-radius:8px; padding:8px; }
dialog form { display:grid; gap:12px; }.dialog-actions { display:flex; gap:8px; flex-wrap:wrap; }.device-row { display:flex; justify-content:space-between; gap:10px; border-top:1px solid #eee; padding:10px 0; align-items:center; font-size:12px; overflow-wrap:anywhere; }
.calendar-option { display:flex; align-items:center; gap:8px; margin:12px 0; }
.time-grid { display:grid; grid-template-columns:50px repeat(7,minmax(90px,1fr)); grid-template-rows:48px repeat(28,24px); min-width:700px; background:repeating-linear-gradient(to bottom,#fff 0,#fff 23px,#eeebf1 24px); }
.calendar:has(.time-grid) { overflow:auto; }.time-corner,.week-heading { background:#f7f5fa; margin:0; border:0; border-radius:0; border-bottom:1px solid #e4e0ec; min-height:48px; padding:10px; font-size:13px; }.time-corner { grid-column:1; grid-row:1; }.week-heading.chosen { background:#e8ddf7; font-weight:700; }.time-label { font-size:11px; color:#7a7387; padding:4px; }.time-event { margin:2px; align-self:stretch; white-space:normal; font-size:11px; padding:4px; z-index:1; overflow:hidden; }.time-event:hover { z-index:3; overflow:auto; }
@media(max-width:1200px) { .calendar-layout { grid-template-columns:minmax(0,1fr); }.detail { margin-top:0; }.app-shell { grid-template-columns:190px minmax(0,1fr); }.page { padding:24px; } }
@media(max-width:720px) { .app-shell { display:block; }.sidebar { padding:16px; border:0; gap:8px; }.brand { font-size:19px; }.view-buttons { grid-template-columns:1fr 1fr; margin:0; }.source-filters { display:flex; flex-wrap:wrap; gap:10px; margin:0; padding-top:12px; }.source-filters h2,.sidebar-caption { display:none; }.source-filters label { font-size:12px; }.sidebar #logout,.sidebar #settings { min-height:36px; padding:4px; }.page { padding:12px; }.day { min-height:90px; }.sync-status { margin-top:12px; }.device-row { flex-wrap:wrap; } }
@media(prefers-color-scheme:dark) { :root { background:#17151c; }.sidebar { background:#201d27; border-color:#393341; }.brand { color:#e9def9; }.calendar-layout .detail,.sync-status span,button { background:#25212d; color:#eee8f5; border-color:#42384c; }.chip[data-source=notion] { background:#49375f; }.chip[data-source=google] { background:#283d59; }.chip[data-source=plan] { background:#35442b; }.time-grid { background:repeating-linear-gradient(to bottom,#25212d 0,#25212d 23px,#3d3546 24px); }.time-corner,.week-heading { background:#211c29; color:#eee8f5; }.week-heading.chosen { background:#4d3869; }.view-buttons [aria-pressed=true] { background:#49375f; color:#f2e8ff; }.calendar-option,dialog input,dialog select { color:inherit; } }
