:root {
  font: 15px/1.5 "Segoe UI", "Malgun Gothic", sans-serif;
  color: #20243b;
  background: #f5f6fb;
  --accent: #4c45bd;
  --muted: #626980;
  --line: #e2e5ef;
  --pale: #efedff;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.sign-in { max-width: 390px; margin: 30px auto; padding: 20px; }
.sign-in form { display: grid; gap: 8px; margin-top: 10px; }
.sign-in input { padding: 9px; border: 1px solid var(--line); border-radius: 8px; width: 100%; }
.backup { display: flex; gap: 6px; padding: 12px; justify-content: space-between; }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 7px 12px; }
button:hover { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: -.04em; }
h2 { font-size: 16px; }
.top { height: 68px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; line-height: 1.15; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.logo { background: var(--accent); color: white; border-radius: 10px; width: 36px; height: 36px; display: grid; place-items: center; font-size: 23px; }
.storage { color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
#export-tasks { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16835a; margin-right: 5px; }
main { display: grid; grid-template-columns: 278px minmax(0, 1fr); gap: 18px; padding: 20px 26px; max-width: 1750px; margin: auto; }
aside { display: grid; align-content: start; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: white; }
.capture, .inbox { padding: 17px; }
label, .hint, .calendar-top p { color: var(--muted); font-size: 13px; }
.capture label { display: block; margin: 6px 0 10px; }
textarea, #task-title { border: 1px solid var(--line); border-radius: 8px; background: #fafaff; padding: 10px; width: 100%; }
textarea { display: block; resize: vertical; min-height: 94px; }
.primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 650; }
.primary:hover { background: #3e369f; }
.capture .primary { width: 100%; margin-top: 10px; }
.inbox-head, .calendar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#count { font-size: 12px; background: var(--pale); color: var(--accent); border-radius: 20px; padding: 1px 8px; }
.hint { margin: 5px 0 12px; }
#inbox { display: grid; gap: 6px; min-height: 42px; }
.empty { padding: 12px 8px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; color: var(--muted); font-size: 13px; }
.calendar { min-width: 0; overflow: hidden; }
.calendar-top { padding: 16px 18px; }
nav { display: flex; gap: 5px; }
nav button { white-space: nowrap; }
.days, .row { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.days { border-block: 1px solid var(--line); background: #f9f9fe; }
.day { border: 0; border-left: 1px solid var(--line); background: transparent; border-radius: 0; text-align: center; font-size: 12px; padding: 7px 0; }
.day b { display: block; font-size: 19px; }
.day.current { color: var(--accent); background: var(--pale); }
.zone { align-self: center; text-align: center; color: var(--muted); font-size: 11px; }
.timeline { --slot-height: 68px; overflow: auto; height: clamp(360px, calc(100dvh - 242px), 1100px); }
.timeline, .days { scrollbar-gutter: stable; }
.days { overflow: hidden; }
.hour { font-size: 12px; color: var(--muted); padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.row { height: var(--slot-height); }
.row:nth-child(2n) .hour { color: #72798e; }
.slot { position: relative; min-width: 0; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px; cursor: pointer; }
.slot.current { background: #faf9ff; }
.slot:hover, .slot.target, #inbox.target { background: #e5e1ff; }
.card { display: flex; min-width: 0; align-items: center; gap: 4px; border: 1px solid #dfdbff; border-radius: 8px; color: #343076; background: #f0eeff; }
.card > button { border: 0; background: transparent; padding: 7px 5px; min-width: 0; }
.card .handle { cursor: grab; touch-action: none; font-size: 16px; }
.card .card-title { flex: 1; text-align: left; overflow-wrap: anywhere; font-size: 13px; }
.card .edit { color: var(--muted); }
[data-color=pink] { --card-bg: #ffe5ef; --card-border: #f2b7cf; --card-ink: #742445; }
[data-color=blue] { --card-bg: #e4f0ff; --card-border: #b5d2f5; --card-ink: #214979; }
[data-color=yellow] { --card-bg: #fff3c6; --card-border: #e9d58b; --card-ink: #694e15; }
[data-color=lime] { --card-bg: #e8f6cf; --card-border: #c4df91; --card-ink: #3d571c; }
[data-color=purple] { --card-bg: #efe5fc; --card-border: #d7bef2; --card-ink: #573278; }
[data-color=orange] { --card-bg: #ffe8d4; --card-border: #f1c19b; --card-ink: #7a3b13; }
[data-color=gray] { --card-bg: #eceef1; --card-border: #cbd0d8; --card-ink: #424b5b; }
.card[data-color], .colors label { color: var(--card-ink); background: var(--card-bg); border-color: var(--card-border); }
.card.selected { outline: 2px solid var(--accent); }
.slot .card { position: absolute; z-index: 1; inset: 2px 3px auto; height: calc(var(--slot-height) * var(--slot-count, 1) - 4px); display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; grid-template-rows: 34px 17px; align-items: center; gap: 0; }
.slot .card > button { padding: 2px 4px; }
.slot .card > .card-title { grid-area: 1 / 1 / 2 / -1; align-self: start; width: 100%; padding: 3px 5px 0; line-height: 15px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot .card > :is(.handle, .complete-task, .cancel-slot, .edit) { grid-row: 2; padding: 0 2px; line-height: 17px; }
.slot .card .handle { grid-column: 1; }
.slot .card .complete-task { grid-column: 3; }
.slot .card .cancel-slot { grid-column: 4; }
.slot .card .edit { grid-column: 5; }
.duration { grid-area: 2 / 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 2px; font-size: 10px; line-height: 11px; pointer-events: none; }
.slot .card .complete-task, .slot .card .cancel-slot { font-weight: 700; color: var(--card-ink); }
.slot .card .complete-task:disabled { background: var(--card-border); cursor: default; }
.slot .card .complete-task:hover, .slot .card .cancel-slot:hover { background: var(--card-border); }
.slot .card .resize { position: absolute; inset: auto 0 0; height: 9px; padding: 0; border-radius: 0 0 7px 7px; cursor: ns-resize; touch-action: none; }
.resize::after { content: ''; display: block; position: absolute; bottom: 2px; left: 50%; width: 18px; height: 2px; translate: -50% 0; border-radius: 2px; background: var(--card-ink); opacity: .58; }
.slot .card .resize:hover, .slot .card .resize:focus-visible { background: var(--card-border); }
.ghost { position: fixed; z-index: 10; pointer-events: none; max-width: 220px; padding: 6px 10px; border-radius: 8px; color: white; background: var(--accent); }
#notice:not(:empty) { position: fixed; z-index: 5; bottom: 18px; right: 20px; max-width: min(370px, 90vw); padding: 10px 14px; border-radius: 9px; color: white; background: #26233d; pointer-events: none; }
dialog { width: min(450px, 92vw); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
dialog::backdrop { background: #20243b60; }
dialog h2 { margin-bottom: 14px; }
dialog label { display: block; margin: 6px 0; }
.colors { display: flex; flex-wrap: wrap; gap: 6px; min-inline-size: 0; border: 0; padding: 0; margin: 12px 0; }
.colors legend { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.colors label { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 4px 8px; border: 1px solid var(--card-border); border-radius: 8px; cursor: pointer; white-space: nowrap; }
.colors input { flex: none; margin: 0; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 16px; }
.danger { color: #a51f3a; }
@media (max-width: 760px) {
  .top { height: 58px; padding: 0 12px; }
  main { grid-template-columns: 1fr; gap: 10px; padding: 10px; }
  aside { gap: 10px; }
  .capture, .inbox { padding: 12px; }
  .calendar-top { padding: 10px; }
  h1 { font-size: 18px; }
  .timeline { height: min(55dvh, 520px); }
  .row { grid-template-columns: 54px minmax(0, 1fr); }
  .days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .days .zone, .slot:not(.active-day) { display: none; }
  .day[aria-pressed=true] { box-shadow: inset 0 -3px var(--accent); }
}
