:root {
  --paper: #f3f0e8;
  --card: #fffdf8;
  --ink: #1c241f;
  --muted: #74766f;
  --line: #dedbd1;
  --accent: #ff5f3d;
  --accent-dark: #d94025;
  --green: #4b8267;
  --shadow: 0 18px 50px rgba(52, 46, 34, .08);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 130, 87, .15), transparent 24rem),
    radial-gradient(circle at 94% 25%, rgba(77, 139, 105, .12), transparent 28rem),
    var(--paper);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 80px;
}

.topbar, .week-nav, .section-heading, .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow, .section-kicker {
  margin: 0 0 5px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-dark);
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(32px, 5vw, 52px); line-height: 1; letter-spacing: -.05em; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -.035em; }

.icon-button, .arrow-button, .add-button, .close-button {
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.icon-button:active, .arrow-button:active, .add-button:active { transform: scale(.96); }
.icon-button { padding: 11px 16px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.45); font-size: 13px; font-weight: 700; }

.week-nav { width: min(390px, 100%); margin: 38px auto 22px; text-align: center; }
.week-label { margin-bottom: 2px; font-size: 19px; font-weight: 800; letter-spacing: -.03em; }
.week-caption { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.arrow-button { width: 43px; height: 43px; border-radius: 50%; background: var(--card); box-shadow: 0 5px 18px rgba(45,42,31,.08); font-size: 20px; }
.arrow-button:hover { background: #fff; }

.timeline-card, .inbox-section {
  background: rgba(255,253,248,.9);
  border: 1px solid rgba(212, 207, 195, .75);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.timeline-card { padding: 24px; }
.inbox-section { margin-top: 18px; padding: 24px; }
.task-count { padding: 7px 11px; border-radius: 99px; background: #eeeae0; color: var(--muted); font-size: 12px; font-weight: 700; }

.calendar-scroll { margin-top: 22px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #d7d1c5 transparent; }
.calendar { min-width: 720px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.day { min-height: 66px; padding: 11px 9px; border-left: 1px solid var(--line); text-align: center; position: relative; }
.day:first-child { border-left: 0; }
.day-name { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.day-number { display: inline-grid; width: 29px; height: 29px; place-items: center; font-size: 14px; font-weight: 700; border-radius: 50%; }
.day.today .day-number { background: var(--ink); color: #fff; }
.day.drop-target { background: rgba(255,95,61,.08); }

.task-lanes { position: relative; min-height: 172px; padding: 12px 0 2px; background-image: linear-gradient(to right, transparent calc(100% - 1px), rgba(222,219,209,.8) 1px); background-size: calc(100% / 7) 100%; }
.lane { height: 48px; position: relative; border-bottom: 1px dashed rgba(208,204,194,.65); }
.task-bubble { position: absolute; top: 7px; height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 4px; border: 0; border-radius: 13px 18px 18px 13px; color: #fff; font-size: 12px; font-weight: 700; cursor: grab; touch-action: none; box-shadow: 0 6px 14px rgba(34,32,26,.16); overflow: hidden; text-align: left; white-space: nowrap; }
.task-bubble:active { cursor: grabbing; }
.bubble-handle { width: 8px; height: 22px; flex: 0 0 8px; border-radius: 99px; background: rgba(255,255,255,.48); cursor: ew-resize; }
.task-bubble span { padding: 0 3px; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.task-bubble::after { content: ""; width: 6px; height: 6px; margin-left: auto; flex: 0 0 auto; border-radius: 50%; background: rgba(255,255,255,.8); }
.task-bubble.clipped-left { border-radius: 2px 18px 18px 2px; }
.task-bubble.clipped-right { border-radius: 13px 2px 2px 13px; }
.empty-calendar { margin: 13px 0 1px; color: var(--muted); font-size: 12px; text-align: center; }

.add-button { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 99px; background: var(--ink); color: white; font-size: 13px; font-weight: 700; }
.add-button span { font-size: 19px; font-weight: 400; line-height: .7; }
.task-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.task-item { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 12px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.58); cursor: grab; transition: transform .2s ease, box-shadow .2s ease; }
.task-item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(44,40,31,.08); }
.task-item.dragging { opacity: .45; }
.color-dot { width: 9px; height: 34px; border-radius: 99px; }
.task-copy { min-width: 0; }
.task-title { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 750; }
.task-deadline { margin: 0; color: var(--muted); font-size: 11px; }
.place-button { width: 34px; height: 34px; border: 0; border-radius: 11px; background: #ece8de; cursor: pointer; font-size: 17px; }
.delete-button { display: none; }
.empty-inbox { display: none; margin: 32px 0 12px; text-align: center; color: var(--muted); }
.empty-inbox.visible { display: block; }
.empty-mark { display: grid; width: 42px; height: 42px; margin: 0 auto 10px; place-items: center; border-radius: 50%; background: #e3eee6; color: var(--green); font-weight: 800; }
.empty-inbox p { margin-bottom: 3px; color: var(--ink); font-weight: 700; }
.empty-inbox small { font-size: 11px; }

dialog { width: min(450px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 25px; background: var(--card); box-shadow: 0 30px 90px rgba(22,22,18,.25); }
dialog::backdrop { background: rgba(30,30,25,.35); backdrop-filter: blur(4px); }
dialog form { padding: 24px; }
.close-button { width: 35px; height: 35px; border-radius: 50%; background: #ece9e0; font-size: 21px; }
label { display: grid; gap: 7px; margin-top: 19px; color: #4e524e; font-size: 12px; font-weight: 700; }
input { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 13px 14px; outline: none; color: var(--ink); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,95,61,.11); }
.primary-button { width: 100%; margin-top: 22px; padding: 14px; border: 0; border-radius: 14px; background: var(--accent); color: white; font-weight: 800; cursor: pointer; }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { width: 100%; margin-top: 9px; padding: 11px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.form-hint { margin: 12px 0 -6px; color: var(--muted); font-size: 11px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 99px; background: var(--ink); color: white; font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .22s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 700px) {
  .app-shell { width: min(100% - 20px, 620px); padding: 24px 0 52px; }
  .timeline-card, .inbox-section { padding: 18px; border-radius: 22px; }
  .task-list { grid-template-columns: 1fr; }
  .week-nav { margin-top: 28px; }
  .calendar-scroll { margin-right: -18px; padding-right: 18px; }
  .calendar { min-width: 665px; }
  .task-lanes { min-height: 155px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
