:root {
  --ink: #27272a;
  --muted: #8a8990;
  --line: #e9e8e5;
  --paper: #f8f8f6;
  --white: #fff;
  --violet: #7659f5;
  --violet-soft: #eeeaff;
  --sidebar: #f2f2ef;
  --shadow: 0 24px 70px rgba(31, 29, 45, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; background: var(--paper); color: var(--ink); font-size: 16px; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 750; letter-spacing: -.6px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; background: var(--violet); font-size: 19px; font-weight: 800; box-shadow: 0 8px 20px rgba(118, 89, 245, .25); }

/* Authentication */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1fr) minmax(460px, 1fr); background: #fff; }
.auth-story { position: relative; min-height: 100vh; padding: 42px 56px; overflow: hidden; color: #fff; background: radial-gradient(circle at 18% 12%, rgba(255,255,255,.12), transparent 28%), linear-gradient(145deg, #30215e 0%, #5430ab 48%, #7659f5 100%); }
.auth-story::before, .auth-story::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.auth-story::before { width: 560px; height: 560px; right: -220px; top: -160px; }
.auth-story::after { width: 360px; height: 360px; left: -170px; bottom: -130px; }
.brand-light { position: relative; z-index: 2; color: #fff; }
.brand-light .brand-mark { color: #5b3dc4; background: #fff; box-shadow: none; }
.story-copy { position: relative; z-index: 2; max-width: 640px; margin-top: clamp(110px, 19vh, 190px); }
.story-kicker { display: inline-block; margin-bottom: 22px; color: #d9d0ff; font-size: 13px; font-weight: 760; letter-spacing: 2px; }
.story-copy h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 5.2vw, 82px); font-weight: 500; line-height: .98; letter-spacing: -3px; }
.story-copy p { max-width: 530px; margin: 30px 0 0; color: #e4dfff; font-size: 19px; line-height: 1.6; }
.floating-card { position: absolute; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 15px 19px; border: 1px solid rgba(255,255,255,.2); border-radius: 16px; background: rgba(255,255,255,.13); box-shadow: 0 18px 44px rgba(29,13,72,.2); backdrop-filter: blur(14px); font-size: 14px; }
.card-one { right: 7%; bottom: 21%; transform: rotate(-3deg); }
.card-two { right: 20%; bottom: 10%; transform: rotate(4deg); }
.fake-check { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: #fff; color: var(--violet); font-weight: 800; }
.drag-dots { color: #cfc4ff; font-size: 23px; line-height: 1; }
.story-foot { position: absolute; left: 56px; bottom: 36px; color: rgba(255,255,255,.65); font-size: 13px; }
.auth-panel { display: grid; place-items: center; padding: 42px; background: #fbfbfa; }
.auth-box { width: min(100%, 430px); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1.35fr; gap: 4px; padding: 4px; border-radius: 13px; background: #eeedeb; }
.auth-tabs button { height: 42px; border: 0; border-radius: 10px; background: transparent; color: #7d7c82; font-size: 14px; font-weight: 650; cursor: pointer; }
.auth-tabs button.active { color: var(--ink); background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.auth-heading { margin: 48px 0 30px; }
.auth-heading h2 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 38px; font-weight: 500; letter-spacing: -1.2px; }
.auth-heading p { margin: 0; color: var(--muted); }
.auth-form { display: grid; gap: 20px; }
.auth-form label { display: grid; gap: 9px; font-size: 14px; font-weight: 650; }
.auth-form input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid #deddd9; border-radius: 12px; outline: none; background: #fff; transition: border-color .2s, box-shadow .2s; }
.auth-form input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(118, 89, 245, .12); }
.primary-button { height: 52px; margin-top: 6px; border: 0; border-radius: 12px; color: #fff; background: var(--violet); box-shadow: 0 10px 24px rgba(118,89,245,.25); font-weight: 700; cursor: pointer; transition: transform .15s, background .2s; }
.primary-button:hover { background: #694be9; transform: translateY(-1px); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.form-error { min-height: 22px; margin-top: 18px; color: #c7483c; font-size: 14px; }

/* App */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; height: 100vh; padding: 30px 22px 22px; border-right: 1px solid #e5e4e0; background: var(--sidebar); }
.sidebar .brand { margin: 0 10px 46px; }
.sidebar-label { margin: 0 12px 12px; color: #9a999f; font-size: 11px; font-weight: 800; letter-spacing: 1.35px; }
.lists { display: grid; gap: 4px; }
.list-link { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; align-items: center; gap: 11px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; transition: background .18s, transform .18s; }
.list-link:hover { background: rgba(255,255,255,.66); }
.list-link.selected { background: #fff; box-shadow: 0 2px 12px rgba(37,34,53,.055); font-weight: 700; }
.list-dot { width: 9px; height: 9px; border-radius: 3px; }
.list-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-count { display: grid; place-items: center; min-width: 23px; height: 23px; padding: 0 6px; border-radius: 8px; color: #77767c; background: #ecebe8; font-size: 12px; font-weight: 700; }
.new-list-button { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 10px; padding: 8px 12px; border: 0; background: transparent; color: #77767d; cursor: pointer; text-align: left; }
.new-list-button span { font-size: 21px; font-weight: 300; }
.new-list-button:hover { color: var(--violet); }
.new-list-form { margin: 10px 6px 0; }
.new-list-form input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--violet); border-radius: 9px; background: #fff; outline: 3px solid rgba(118,89,245,.1); }
.profile { display: grid; grid-template-columns: 38px minmax(0,1fr) 34px; align-items: center; gap: 10px; margin-top: auto; padding: 14px 9px 0; border-top: 1px solid #deddd9; }
.avatar, .member-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: #2f2e35; font-size: 13px; font-weight: 750; }
.profile-copy { display: grid; min-width: 0; gap: 2px; }
.profile-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.profile-copy small { overflow: hidden; color: #99989e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #99989e; font-size: 20px; cursor: pointer; }
.logout-button:hover { color: var(--ink); background: #e8e7e3; }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 74px; padding: 0 40px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); }
.sync-state { display: flex; align-items: center; gap: 8px; color: #9a999f; font-size: 13px; }
.sync-state span { width: 7px; height: 7px; border-radius: 50%; background: #35a878; box-shadow: 0 0 0 3px rgba(53,168,120,.12); }
.top-actions { display: flex; align-items: center; gap: 16px; }
.member-avatars { display: flex; padding-left: 10px; }
.member-avatars span { display: grid; place-items: center; width: 30px; height: 30px; margin-left: -9px; border: 2px solid #fff; border-radius: 50%; color: #4b3a99; background: #ded7ff; font-size: 11px; font-weight: 800; }
.share-button { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 0; border-radius: 10px; color: #fff; background: #2f2e35; font-size: 14px; font-weight: 650; cursor: pointer; }
.share-button:hover { background: #111114; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 23px; cursor: pointer; }
.content { width: min(840px, calc(100% - 56px)); margin: 0 auto; padding: 70px 0 110px; }
.list-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 38px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #9b9aa0; font-size: 11px; font-weight: 800; letter-spacing: 1.4px; }
.eyebrow span { width: 9px; height: 9px; border-radius: 3px; }
.list-heading h1 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 62px); font-weight: 500; line-height: 1; letter-spacing: -2.3px; }
.list-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.more-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: #77767c; letter-spacing: 2px; cursor: pointer; }
.more-button:hover { color: #c7473d; border-color: #efccc8; }
.task-section { min-height: 80px; margin-top: 34px; }
.section-title { display: flex; align-items: center; gap: 9px; margin: 0 6px 12px; color: #99989e; font-size: 11px; font-weight: 800; letter-spacing: 1.35px; }
.section-title b { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 7px; color: #85848a; background: #eae9e6; font-size: 11px; letter-spacing: 0; }
.task-list { display: grid; gap: 9px; }
.checklist-editor { overflow: hidden; border: 1px solid #dfddd9; border-radius: 16px; background: #fff; box-shadow: 0 10px 36px rgba(35,32,54,.055); transition: border-color .2s, box-shadow .2s; }
.checklist-editor:focus-within { border-color: #a997f8; box-shadow: 0 12px 38px rgba(77,54,180,.1), 0 0 0 4px rgba(118,89,245,.07); }
.checklist-editor .active-list { gap: 0; }
.checklist-editor .task-row { min-height: 54px; border: 0; border-bottom: 1px solid #efeeeb; border-radius: 0; box-shadow: none; }
.checklist-editor .task-row:hover { background: #fcfcfb; }
.checklist-compose { display: grid; grid-template-columns: 26px 28px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 57px; padding: 7px 14px 7px 8px; }
.compose-grip { width: 26px; color: #d2d1d4; font-size: 22px; line-height: 1; text-align: center; }
.compose-check { display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid #d0ced3; border-radius: 8px; color: transparent; font-size: 14px; }
.checklist-compose input { min-width: 0; height: 42px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.checklist-compose input::placeholder { color: #aaa9ae; }
.checklist-compose kbd { padding: 5px 8px; border: 1px solid #deddd9; border-bottom-width: 2px; border-radius: 6px; color: #aaa9ae; background: #f8f8f6; font-family: inherit; font-size: 11px; }
.task-row { position: relative; display: grid; grid-template-columns: 26px 28px minmax(0,1fr) 30px; align-items: center; gap: 10px; min-height: 57px; padding: 7px 12px 7px 8px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 15px rgba(38,35,54,.025); animation: task-in .28s ease both; transition: opacity .2s, transform .2s, border-color .2s, background .2s; }
@keyframes task-in { from { opacity: 0; transform: translateY(-7px) scale(.99); } }
.task-row:hover { border-color: #d8d6d2; }
.task-row.dragging { opacity: .2; border-style: dashed; border-color: var(--violet); background: var(--violet-soft); transform: scale(.99); }
.drag-ghost { position: fixed !important; z-index: 1000; margin: 0; pointer-events: none; opacity: .96; border: 1px solid #a997f8 !important; border-radius: 13px !important; background: #fff !important; box-shadow: 0 20px 48px rgba(50,35,120,.25) !important; animation: none !important; transform: rotate(1.5deg) scale(1.015); }
.drag-ghost .task-delete { display: none; }
.touch-ghost { transform: translate(-8px, -42px) rotate(1.5deg) scale(1.02); }
.task-row.drop-target::before { content: ""; position: absolute; z-index: 3; left: 8px; right: 8px; top: -4px; height: 3px; border-radius: 3px; background: var(--violet); box-shadow: 0 0 0 3px rgba(118,89,245,.12); }
.task-section.drop-zone-hover { border-radius: 16px; outline: 2px dashed rgba(118,89,245,.45); outline-offset: 7px; }
.drag-handle { width: 26px; height: 34px; border: 0; background: transparent; color: #c1c0c4; font-size: 22px; line-height: 1; cursor: grab; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.task-check { display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid #d0ced3; border-radius: 8px; background: transparent; color: transparent; font-size: 14px; font-weight: 900; cursor: pointer; transition: all .22s; }
.task-check:hover { border-color: var(--violet); color: #b8abf8; }
.task-title { overflow-wrap: anywhere; line-height: 1.4; }
.task-delete { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: transparent; font-size: 22px; cursor: pointer; transition: color .18s, background .18s; }
.task-row:hover .task-delete { color: #bbb9be; }
.task-delete:hover { color: #d55248 !important; background: #fff0ef; }
.task-row.is-done { color: #aaa9ad; background: rgba(255,255,255,.58); }
.task-row.is-done .task-check { border-color: var(--violet); color: #fff; background: var(--violet); }
.task-row.is-done .task-title { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: #c9c7cc; }
.done-section { padding-top: 12px; border-top: 1px solid var(--line); }
.done-toggle { width: auto; padding: 0; border: 0; background: transparent; cursor: pointer; }
.done-toggle span { display: flex; align-items: center; gap: 5px; }
.done-toggle i { display: inline-block; font-style: normal; font-size: 18px; transition: transform .2s; }
.done-toggle i.collapsed { transform: rotate(-90deg); }
.done-list { opacity: .86; }
.empty-active { display: grid; place-items: center; min-height: 170px; padding: 24px; border: 1px dashed #dcdbd7; border-radius: 14px; color: #aaa9ae; text-align: center; }
.empty-active span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 7px; border-radius: 13px; color: var(--violet); background: var(--violet-soft); font-size: 21px; font-weight: 800; }
.empty-active strong { color: #737278; font-size: 15px; }
.empty-active p { margin: 2px 0 0; font-size: 13px; }
.empty-app, .fatal-state { display: grid; place-items: center; min-height: 55vh; color: var(--muted); text-align: center; }
.empty-app > span { color: var(--violet); font-size: 50px; font-weight: 200; }
.empty-app h1 { margin: 4px 0 16px; color: var(--ink); font-family: Georgia, serif; font-weight: 500; }
.empty-app button, .fatal-state button { padding: 10px 16px; border: 0; border-radius: 9px; color: #fff; background: var(--violet); cursor: pointer; }
.loading { display: flex; justify-content: center; gap: 7px; padding-top: 30vh; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); animation: bounce 1s infinite alternate; }
.loading span:nth-child(2) { animation-delay: .18s; }.loading span:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { to { opacity: .25; transform: translateY(-8px); } }

/* Sharing */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(27,25,36,.42); backdrop-filter: blur(5px); animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.share-modal { position: relative; width: min(100%, 520px); max-height: calc(100vh - 44px); overflow: auto; padding: 34px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); animation: modal-in .24s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-close { position: absolute; right: 18px; top: 17px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: #f3f2f0; color: #88878c; font-size: 22px; cursor: pointer; }
.modal-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 17px; border-radius: 14px; color: var(--violet); background: var(--violet-soft); font-size: 24px; }
.share-modal h2 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 31px; font-weight: 500; letter-spacing: -.7px; }
.share-modal > p { margin: 0 35px 24px 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.invite-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.invite-form input { min-width: 0; height: 44px; padding: 0 13px; border: 1px solid #deddd9; border-radius: 10px; outline: none; }
.invite-form input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(118,89,245,.1); }
.invite-form button { padding: 0 15px; border: 0; border-radius: 10px; color: #fff; background: var(--violet); font-size: 14px; font-weight: 650; cursor: pointer; }
.owner-note { margin-bottom: 24px; padding: 13px; border-radius: 10px; color: #7568a4; background: #f3f0ff; font-size: 13px; }
.member-list { display: grid; gap: 4px; margin-top: 18px; }
.member-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 52px; padding: 6px; border-radius: 10px; }
.member-avatar { width: 36px; height: 36px; background: #302e36; }
.member-avatar.soft { color: #513caa; background: #e5e0fc; }
.member-row > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.member-row strong { overflow: hidden; text-overflow: ellipsis; font-size: 14px; white-space: nowrap; }
.member-row small { color: var(--muted); font-size: 12px; }
.member-row > button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #aaa9ad; font-size: 20px; cursor: pointer; }
.member-row > button:hover { color: #d55248; background: #fff0ef; }
.list-actions-form { display: grid; gap: 14px; padding: 6px 0 28px; }
.list-actions-form label { display: grid; gap: 9px; color: #626168; font-size: 13px; font-weight: 700; }
.list-actions-form input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #deddd9; border-radius: 10px; outline: 0; }
.list-actions-form input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(118,89,245,.1); }
.save-list-button { height: 44px; border: 0; border-radius: 10px; color: #fff; background: var(--violet); font-weight: 700; cursor: pointer; }
.save-list-button:disabled { opacity: .6; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid var(--line); }
.danger-zone > div { display: grid; gap: 3px; }
.danger-zone strong { font-size: 14px; }
.danger-zone small { color: var(--muted); font-size: 12px; }
.danger-zone button { height: 38px; padding: 0 14px; border: 1px solid #efc8c4; border-radius: 9px; color: #c7473d; background: #fff4f3; font-size: 13px; font-weight: 700; cursor: pointer; }
.danger-zone button:hover { color: #fff; background: #c7473d; border-color: #c7473d; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 26px; max-width: min(90vw, 520px); padding: 13px 18px; border-radius: 11px; color: #fff; background: #2f2e35; box-shadow: 0 15px 35px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .2s, transform .2s; font-size: 14px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sidebar-backdrop { display: none; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 360px; padding: 28px; }
  .story-copy { margin-top: 65px; }
  .story-copy h1 { font-size: 47px; letter-spacing: -2px; }
  .story-copy p { margin-top: 18px; font-size: 16px; }
  .floating-card, .story-foot { display: none; }
  .auth-panel { padding: 54px 24px 70px; }
  .auth-heading { margin-top: 38px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: min(300px, 88vw); transform: translateX(-105%); transition: transform .24s ease; box-shadow: 20px 0 50px rgba(26,24,36,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { position: fixed; inset: 0; z-index: 50; display: block; background: rgba(28,27,34,.33); }
  .mobile-menu { display: block; }
  .topbar { padding: 0 22px; }
  .content { width: min(840px, calc(100% - 38px)); padding-top: 44px; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .auth-story { min-height: 320px; }
  .story-copy { margin-top: 54px; }
  .story-copy h1 { font-size: 39px; }
  .auth-panel { place-items: start center; }
  .auth-heading h2 { font-size: 32px; }
  .topbar { height: 64px; padding: 0 16px; }
  .sync-state { display: none; }
  .top-actions { margin-left: auto; }
  .share-button { width: 40px; padding: 0; justify-content: center; }
  .share-button span { display: none; }
  .content { width: calc(100% - 28px); padding-top: 36px; }
  .list-heading { margin-bottom: 28px; }
  .list-heading h1 { font-size: 42px; letter-spacing: -1.7px; }
  .checklist-compose { grid-template-columns: 24px 26px minmax(0,1fr); gap: 7px; padding-right: 10px; }
  .checklist-compose kbd { display: none; }
  .task-row { grid-template-columns: 24px 26px minmax(0,1fr) 25px; gap: 7px; padding-right: 8px; }
  .task-delete { color: #c5c3c8; }
  .share-modal { padding: 28px 20px; }
  .invite-form { grid-template-columns: 1fr; }
  .invite-form button { height: 43px; }
}
