:root {
  --rosewater:#f2d5cf; --flamingo:#eebebe; --pink:#f4b8e4; --mauve:#ca9ee6;
  --red:#e78284; --maroon:#ea999c; --peach:#ef9f76; --yellow:#e5c890;
  --green:#a6d189; --teal:#81c8be; --sky:#99d1db; --sapphire:#85c1dc;
  --blue:#8caaee; --lavender:#babbf1; --text:#c6d0f5; --subtext:#a5adce;
  --overlay0:#737994; --surface2:#626880; --surface1:#51576d; --surface0:#414559;
  --base:#303446; --mantle:#292c3c; --crust:#232634;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--crust); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, var(--surface0), var(--crust) 55%);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  padding: 28px;
}
button, input, select, textarea { font: inherit; }
button, input, select, textarea {
  background: var(--mantle);
  color: var(--text);
  border: 2px solid var(--surface1);
  padding: 10px 12px;
}
textarea { resize: vertical; min-height: 44px; }
button { cursor: pointer; color: var(--green); }
button:hover, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--green); outline: none; box-shadow: 0 0 0 2px rgba(166, 209, 137, .14);
}
button.primary { color: var(--crust); background: var(--green); border-color: var(--green); font-weight: 800; }
button.danger { color: var(--red); }
button.selected { border-color: var(--pink); color: var(--pink); background: rgba(244, 184, 228, .08); }
.hidden { display: none !important; }
.muted { color: var(--subtext); }
.error-text { min-height: 1.2em; color: var(--red); margin: 8px 0 0; }
.app-shell { width: min(1180px, 100%); margin: 0 auto; }
.panel, .terminal-card {
  background: rgba(48, 52, 70, 0.96);
  border: 2px solid var(--surface1);
  box-shadow: 10px 10px 0 var(--crust);
  padding: 20px;
  position: relative;
}
.panel::before, .terminal-card::before {
  content: "┌──────────────────────────────────────────────┐";
  color: var(--surface1); position: absolute; top: -14px; left: 10px; font-size: 12px; opacity: .72; pointer-events: none;
}
.hero-panel { margin-bottom: 24px; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.kicker { margin: 0 0 5px; color: var(--green); }
h1 { margin: 0; font-size: clamp(34px, 7vw, 72px); line-height: .9; letter-spacing: -3px; }
h2 { margin: 8px 0 10px; color: var(--text); }
h3 { margin: 10px 0; color: var(--peach); }
.badge { border: 1px solid var(--lavender); color: var(--lavender); padding: 8px 10px; white-space: nowrap; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.subtext { color: var(--subtext); max-width: 800px; }
.day-line { display: flex; justify-content: space-between; gap: 16px; color: var(--blue); margin: 16px 0 7px; font-size: 13px; }
.progress-label, .pet-readout, .readout-grid { display: flex; justify-content: space-between; gap: 16px; color: var(--subtext); }
.progress-bar { height: 18px; border: 2px solid var(--surface1); background: var(--mantle); overflow: hidden; }
#progressFill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--green), var(--teal), var(--blue)); transition: width .45s ease; }
.status-line { color: var(--yellow); margin-top: 12px; min-height: 1.25em; }
.care-readout { color: var(--pink); white-space: nowrap; margin-top: 12px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 24px; }
.panel-title, .terminal-title { color: var(--peach); margin-bottom: 14px; font-weight: 800; letter-spacing: .04em; }
.task-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; margin-bottom: 12px; }
.task-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 520px; overflow: auto; }
.task-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 9px; align-items: center; border: 1px solid var(--surface1); padding: 10px; background: var(--mantle); }
.task-list input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
.task-main { min-width: 0; }
.task-text { display: block; color: var(--text); overflow-wrap: anywhere; }
.task-meta { display: block; color: var(--overlay0); font-size: 12px; margin-top: 4px; }
.task-list li.done .task-text { color: var(--subtext); text-decoration: line-through; }
.task-list li.overdue { border-color: var(--red); }
.icon-button { padding: 5px 8px; }
.remove { color: var(--red); padding: 5px 8px; }
.task-actions, .settings-tools, .sync-actions, .quick-buttons { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.empty-state { border: 1px dashed var(--surface2); color: var(--subtext); padding: 18px; text-align: center; }
.pet-panel { min-height: 540px; }
.tank { height: 390px; border: 2px solid var(--surface1); background: linear-gradient(180deg, rgba(35,38,52,.8), rgba(41,44,60,.95)); position: relative; overflow: hidden; }
.tank::after { content: ""; position: absolute; inset: auto 0 0; height: 78px; background: repeating-linear-gradient(90deg, rgba(166,209,137,.1) 0 20px, rgba(229,200,144,.08) 20px 40px); border-top: 2px solid rgba(166,209,137,.2); }
.lamp { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 86px; height: 46px; border: 2px solid var(--surface1); border-radius: 50% 50% 8px 8px; background: var(--crust); z-index: 2; }
.lamp span { position: absolute; top: 42px; left: 50%; transform: translateX(-50%); width: 150px; height: 0; border-left: 55px solid transparent; border-right: 55px solid transparent; border-top: 190px solid rgba(229, 200, 144, 0); transition: border-top-color .6s ease; }
.lamp.on { border-color: var(--yellow); box-shadow: 0 0 22px rgba(229,200,144,.45); }
.lamp.on span { border-top-color: rgba(229, 200, 144, .14); }
.tortoise { position: absolute; width: 118px; left: 42%; bottom: 32px; z-index: 3; transition: left 3.8s linear, transform .4s ease, opacity .4s ease; filter: drop-shadow(0 9px 10px rgba(0,0,0,.35)); }
.tortoise.sleeping { width: 105px; opacity: .88; }
.tortoise.soaking { width: 98px; }
.soak-bowl { position: absolute; left: 56%; bottom: 18px; z-index: 1; width: 150px; height: 70px; border: 2px solid var(--blue); color: var(--blue); border-radius: 0 0 50% 50%; display: grid; place-items: center; font-size: 28px; opacity: .95; }
.food { position: absolute; left: 22%; bottom: 46px; z-index: 2; font-size: 34px; }
.hat-overlay { position: absolute; z-index: 4; font-size: 34px; pointer-events: none; transition: left 3.8s linear; text-shadow: 0 4px 8px #000; }
.pet-readout { margin-top: 12px; }
.pet-timer { color: var(--blue); font-size: 13px; margin-top: 8px; min-height: 1.2em; }
.overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(35, 38, 52, .94); display: grid; place-items: center; padding: 24px; overflow: auto; }
.setup-card { width: min(680px, 100%); }
.setup-actions.stack { display: grid; gap: 12px; margin-top: 20px; }
.prompt-line { color: var(--subtext); }
.prompt { color: var(--green); }
.install-log { min-height: 230px; white-space: pre-wrap; color: var(--text); background: var(--crust); border: 1px solid var(--surface1); padding: 14px; overflow: auto; }
.install-progress { height: 16px; border: 2px solid var(--surface1); background: var(--mantle); }
.install-progress > div { width: 0; height: 100%; background: var(--green); transition: width .25s ease; }
.name-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.secret-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: stretch; }
.secret-output { min-width: 0; }
.qr-box { width: 190px; min-height: 190px; margin: 18px auto; background: #fff; padding: 10px; display: grid; place-items: center; }
.qr-box.large { width: 230px; min-height: 230px; }
.qr-box img, .qr-box canvas { max-width: 100%; height: auto !important; }
.acknowledgement { justify-content: center; }
.dialog { width: min(680px, calc(100vw - 36px)); max-height: calc(100vh - 48px); overflow: auto; color: var(--text); }
.dialog::backdrop { background: rgba(35, 38, 52, .82); }
.wide-dialog { width: min(920px, calc(100vw - 36px)); }
.field { display: grid; gap: 7px; margin: 12px 0; }
.field > span, .field-label { color: var(--subtext); }
.field input, .field select, .field textarea { width: 100%; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.schedule-fields, .task-structure { border-left: 2px solid var(--surface1); padding-left: 14px; margin: 12px 0; }
.weekday-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.weekday-grid label { display: grid; place-items: center; gap: 5px; border: 1px solid var(--surface1); padding: 7px 3px; font-size: 12px; color: var(--subtext); }
.weekday-grid input { width: 16px; height: 16px; accent-color: var(--green); }
.check-row { display: flex; gap: 10px; align-items: flex-start; color: var(--subtext); margin: 14px 0; }
.check-row input { width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.prefix-input { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0; }
.prefix-input span { background: var(--crust); border: 2px solid var(--surface1); border-right: 0; padding: 10px 12px; color: var(--green); white-space: nowrap; }
.prefix-input input { border-left-style: dashed; }
.danger-zone { border-top: 1px dashed var(--red); margin-top: 20px; padding-top: 14px; }
.all-tasks-list, .history-list, .shop-list { display: grid; gap: 8px; }
.all-task-row, .history-day, .shop-item, .detail-box { border: 1px solid var(--surface1); padding: 10px; background: var(--mantle); }
.all-task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
.all-task-row small, .history-day small, .detail-box small { display: block; color: var(--overlay0); margin-top: 4px; }
.detail-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.detail-list li { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--surface1); padding: 8px; background: var(--crust); }
.log-entry { border-left: 2px solid var(--green); padding-left: 10px; color: var(--subtext); }
.add-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 8px; }
.history-day summary { cursor: pointer; color: var(--green); font-weight: 800; }
.history-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.history-journal { border-top: 1px dashed var(--surface1); margin-top: 12px; padding-top: 12px; }
.shop-balance { color: var(--pink); margin-bottom: 14px; }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.shop-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; }
.shop-icon { font-size: 26px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 2000; display: grid; gap: 10px; width: min(430px, calc(100vw - 44px)); }
.toast { background: var(--mantle); border: 2px solid var(--green); color: var(--text); padding: 13px 15px; box-shadow: 7px 7px 0 var(--crust); animation: toast-in .18s ease-out; }
.toast.error { border-color: var(--red); }
.toast.big { border-color: var(--yellow); color: var(--yellow); font-size: 18px; font-weight: 800; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 900px) { body { padding: 18px; } .grid, .shop-grid, .history-columns { grid-template-columns: 1fr; } .title-row { flex-direction: column; } .top-actions { justify-content: flex-start; } .task-form { grid-template-columns: 1fr 1fr; } .task-form input { grid-column: 1 / -1; } }
@media (max-width: 640px) { .weekday-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .two-col { grid-template-columns: 1fr; } .secret-row { grid-template-columns: 1fr 1fr; } .secret-row input { grid-column: 1 / -1; } .task-list li { grid-template-columns: auto minmax(0, 1fr) auto; } .task-list li .remove, .task-list li .icon-button:nth-last-child(2) { grid-column: 3; } .day-line, .readout-grid { flex-direction: column; gap: 4px; } .all-task-row, .shop-item { grid-template-columns: minmax(0,1fr); } .prefix-input { grid-template-columns: 1fr; } .prefix-input span { border-right: 2px solid var(--surface1); border-bottom: 0; } .prefix-input input { border-left: 2px solid var(--surface1); } }

.account-box { margin-top: 14px; display: grid; gap: 12px; }
.account-box h3 { margin: 10px 0 0; color: var(--yellow); font-size: 15px; }
