:root {
  --ink: #191919;
  --muted: #787774;
  --faint: #9b9a97;
  --line: #e9e9e7;
  --paper: #ffffff;
  --white: #ffffff;
  --accent: #191919;
  --accent-dark: #37352f;
  --accent-pale: #f1f1ef;
  --green: #7c9870;
  --shadow: 0 10px 30px rgba(25, 25, 25, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { max-width: 1160px; min-height: 100vh; margin: 0 auto; padding: 30px 42px 28px; }
.topbar, .section-heading, .footer, .dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { display: grid; width: 27px; height: 27px; place-items: center; color: var(--white); background: var(--ink); border-radius: 4px; font-size: 14px; }
.button { border: 0; border-radius: 4px; font-size: 12px; font-weight: 600; letter-spacing: -0.01em; transition: transform .18s, background .18s, color .18s; }
.button:hover { transform: translateY(-1px); }
.button-primary { display: inline-flex; align-items: center; gap: 7px; padding: 11px 16px; color: var(--white); background: var(--ink); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { display: inline-flex; gap: 8px; align-items: center; padding: 11px 15px; color: var(--accent-dark); background: var(--accent-pale); }
.button-ghost { padding: 11px 16px; color: var(--muted); background: transparent; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; padding: 116px 0 90px; }
.eyebrow { margin: 0 0 15px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 20px; font-size: clamp(42px, 6vw, 72px); font-weight: 600; letter-spacing: -.075em; line-height: .98; }
h1 em { color: var(--ink); font-family: Georgia, serif; font-weight: 400; letter-spacing: -.07em; }
.hero-copy { margin: 0; color: var(--muted); font-size: 14px; }
.today-card { padding: 16px 22px; border: 1px solid var(--line); border-radius: 4px; text-align: right; }
.today-label { display: block; margin-bottom: 7px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.today-card strong { font-size: 14px; font-weight: 600; }

.deadline-section { padding-bottom: 64px; }
.section-heading { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.03em; }
.section-heading h2 span { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; margin-left: 5px; color: var(--muted); background: var(--accent-pale); border-radius: 4px; font-size: 10px; vertical-align: 2px; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-hint { margin: 21px 0 0; color: var(--faint); font-size: 11px; }
.deadline-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; }
.deadline-card { position: relative; min-width: 0; padding: 25px 26px 22px; background: var(--white); border: 1px solid var(--line); border-radius: 4px; transition: border .18s, box-shadow .18s; }
.deadline-card:hover { border-color: #ddd8d0; box-shadow: 0 8px 25px rgba(35, 31, 27, .04); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.deadline-title { margin: 0; overflow: hidden; font-size: 16px; font-weight: 600; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.deadline-date { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.menu-wrap { position: relative; }
.icon-button { display: grid; width: 28px; height: 28px; place-items: center; flex: 0 0 auto; color: var(--muted); background: transparent; border: 0; border-radius: 4px; font-size: 21px; line-height: 1; }
.icon-button:hover { color: var(--ink); background: var(--paper); }
.menu { position: absolute; z-index: 2; top: 32px; right: 0; width: 110px; padding: 5px; background: var(--white); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); }
.menu button { display: block; width: 100%; padding: 8px 9px; color: var(--ink); background: transparent; border: 0; border-radius: 4px; font-size: 11px; text-align: left; }
.menu button:hover { background: var(--paper); }
.menu .delete-action { color: #b44b4b; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 29px; }
.unit { padding: 13px 8px 11px; background: #f7f7f5; border-radius: 4px; text-align: center; }
.unit-value { display: block; color: var(--ink); font-family: "DM Mono", monospace; font-size: 21px; letter-spacing: -.08em; }
.unit-label { display: block; margin-top: 5px; color: var(--faint); font-size: 9px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.deadline-card.expired { background: #fbfbfa; }
.deadline-card.expired .unit-value { color: var(--accent); }
.expired-label { margin: 29px 0 17px; color: #b44b4b; font-size: 11px; font-weight: 600; }

.empty-state { padding: 72px 20px 88px; color: var(--muted); text-align: center; }
.empty-icon { display: grid; width: 53px; height: 53px; margin: 0 auto 20px; place-items: center; color: var(--ink); background: var(--accent-pale); border-radius: 4px; font-size: 25px; }
.empty-state h3 { margin-bottom: 10px; color: var(--ink); font-size: 18px; letter-spacing: -.04em; }
.empty-state p { max-width: 320px; margin: 0 auto 23px; font-size: 12px; line-height: 1.7; }
.footer { padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.status { display: flex; align-items: center; gap: 7px; }
.status i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }

.deadline-dialog { width: min(430px, calc(100% - 32px)); padding: 30px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.deadline-dialog::backdrop { background: rgba(36, 34, 31, .2); backdrop-filter: blur(3px); }
.dialog-heading { align-items: flex-start; margin-bottom: 28px; }
.dialog-heading .eyebrow { margin-bottom: 10px; }
.dialog-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.05em; }
.deadline-dialog label { display: block; margin: 17px 0 8px; font-size: 11px; font-weight: 600; }
.deadline-dialog input { width: 100%; padding: 12px 13px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 7px; outline: 0; font-size: 13px; }
.deadline-dialog input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-pale); }
.form-error { min-height: 16px; margin: 9px 0 0; color: #b44b4b; font-size: 11px; }
.dialog-actions { justify-content: flex-end; gap: 8px; margin-top: 18px; }

@media (max-width: 680px) {
  .app-shell { padding: 22px 20px 24px; }
  .hero { display: block; padding: 82px 0 60px; }
  .today-card { display: inline-block; margin-top: 34px; text-align: left; }
  .deadline-list { grid-template-columns: 1fr; }
  .footer { align-items: flex-start; flex-direction: column; gap: 10px; }
}

@media (max-width: 420px) {
  .topbar .button-primary { padding: 10px 12px; }
  .topbar .button-primary span { font-size: 17px; line-height: 10px; }
  .topbar .button-primary { font-size: 0; }
  .topbar .button-primary span { font-size: 18px; }
  .deadline-card { padding: 21px 18px 18px; }
  .unit-value { font-size: 18px; }
}
