:root {
  --bg: #f6f7f3;
  --panel: #fff;
  --text: #20342e;
  --muted: #66736c;
  --line: #dce3dc;
  --accent: #235d50;
  --soft: #e9f0e7;
  --shadow: 0 8px 32px #163b2710;
  --danger: #b53e32;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.55 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
body.dark {
  --bg: #121b18;
  --panel: #1b2822;
  --text: #edf3ed;
  --muted: #acbdb2;
  --line: #35483e;
  --accent: #87d5b9;
  --soft: #263c31;
  --shadow: none;
  --danger: #ff9d91;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button,
.filebutton,
.ghost {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
button {
  background: var(--accent);
  color: var(--panel);
  font-weight: 650;
}
button:hover,
.filebutton:hover {
  filter: brightness(0.93);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.secondary,
.filebutton {
  background: var(--soft);
  color: var(--text);
  border-color: var(--line);
}
.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.danger {
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--line);
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}
input[type="color"] {
  width: 70px;
  padding: 3px;
  height: 42px;
}
input[type="range"] {
  padding: 0;
}
label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
label > input,
label > select,
label > textarea {
  margin-top: 6px;
}
label.check {
  display: flex;
  gap: 9px;
  align-items: center;
}
label.check input {
  margin: 0;
}
textarea {
  resize: vertical;
  min-height: 180px;
  font-weight: 400;
  line-height: 1.6;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(28px, 3.3vw, 43px);
  letter-spacing: -1.6px;
  line-height: 1.15;
  margin-bottom: 14px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 16px;
}
p {
  color: var(--muted);
}
.sidebar {
  position: fixed;
  width: 254px;
  inset: 0 auto 0 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -1px;
}
.brandmark {
  background: #235d50;
  color: white;
  border-radius: 12px;
  width: 43px;
  height: 43px;
  text-align: center;
  position: relative;
}
.brandmark span {
  color: #e8c465;
  font-size: 20px;
  position: absolute;
  right: 3px;
  top: -7px;
}
.brand small {
  display: block;
  letter-spacing: 1.3px;
  font-size: 9px;
  color: var(--muted);
}
.search {
  margin: 32px 0 18px;
}
.search span {
  position: absolute;
  clip-path: inset(100%);
}
nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  margin: 3px 0;
}
nav a.active {
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
}
nav a span {
  width: 20px;
  text-align: center;
  font-size: 17px;
}
.side-bottom {
  margin-top: auto;
  padding-top: 30px;
  font-size: 11px;
  color: var(--muted);
}
.side-bottom p {
  margin: 9px 0;
}
.side-bottom button,
.side-bottom label {
  width: 100%;
  font-size: 11px;
  margin: 3px 0;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4b8d65;
  margin-right: 5px;
}
.workspace {
  margin-left: 254px;
}
header {
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 42px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
main {
  max-width: 1370px;
  margin: auto;
  padding: 42px;
}
footer {
  margin: 20px 42px;
  border-top: 1px solid var(--line);
  padding: 20px 0;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.intro {
  max-width: 620px;
  font-size: 16px;
  margin-bottom: 30px;
}
.hero {
  padding: 34px;
  border: 1px solid #ceddcc;
  border-radius: 18px;
  background: linear-gradient(110deg, var(--soft), var(--panel));
  margin-bottom: 30px;
  position: relative;
}
.hero h1 {
  max-width: 600px;
}
.hero p {
  max-width: 530px;
}
.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--soft);
  font-size: 11px;
  color: var(--accent);
  font-weight: 650;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card {
  position: relative;
}
.card > a {
  color: inherit;
  text-decoration: none;
}
.card:hover {
  border-color: var(--accent);
}
.card .glyph {
  font-size: 25px;
  margin-bottom: 24px;
  background: var(--soft);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.card h3 {
  margin-bottom: 8px;
}
.card p {
  font-size: 12px;
  margin-bottom: 20px;
}
.pin {
  position: absolute;
  right: 15px;
  top: 15px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 18px;
}
.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}
.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
}
.fieldgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
.small {
  font-size: 12px;
  color: var(--muted);
}
.mt {
  margin-top: 20px;
}
.mb {
  margin-bottom: 20px;
}
.hidden {
  display: none !important;
}
.empty {
  padding: 36px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.filebutton input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(100%);
}
.drop {
  border: 2px dashed var(--line);
  padding: 32px;
  text-align: center;
  border-radius: 12px;
  transition: 0.2s;
}
.drop.drag {
  border-color: var(--accent);
  background: var(--soft);
}
.drop p {
  font-size: 12px;
  margin: 10px 0 0;
}
.result {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  gap: 16px;
  align-items: center;
}
.result img {
  width: 80px;
  height: 70px;
  object-fit: contain;
}
.result .details {
  flex: 1;
  overflow-wrap: anywhere;
}
.status {
  font-size: 13px;
  min-height: 24px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.status.error {
  color: var(--danger);
}
.stat {
  font-size: 28px;
  letter-spacing: -1px;
  font-weight: 700;
}
.noteitem {
  display: block;
  text-align: left;
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  overflow: hidden;
}
.noteitem.active {
  background: var(--soft);
  border-color: var(--accent);
}
.noteitem small {
  display: block;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-editor {
  min-height: 360px;
}
.task {
  padding: 15px 0;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.task .body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.task.done .title {
  text-decoration: line-through;
  color: var(--muted);
}
.task .tag {
  font-size: 10px;
}
.timer {
  text-align: center;
  padding: 34px 20px;
}
.timer-digits {
  font-size: clamp(60px, 9vw, 110px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -5px;
  margin: 25px 0;
}
.timer .row {
  justify-content: center;
}
.clock {
  font-size: 36px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.zonegrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.tablewrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
td,
th {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 600;
}
.working {
  background: var(--soft);
  color: var(--accent);
}
.canvaswrap {
  overflow: auto;
  background: repeating-conic-gradient(#e0e3e0 0% 25%, #f5f5f5 0% 50%) 50%/20px
    20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 130px;
  text-align: center;
}
.canvaswrap canvas {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  touch-action: none;
}
.preview {
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
}
.toolbar button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--panel);
}
.meter {
  height: 5px;
  background: var(--soft);
  border-radius: 5px;
  overflow: hidden;
}
.meter > div {
  height: 100%;
  background: var(--accent);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--text);
  color: var(--panel);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  max-width: 90vw;
}
#toast.show {
  opacity: 1;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  padding: 30px;
  max-width: 450px;
}
dialog::backdrop {
  background: #10201888;
}
.skip {
  position: fixed;
  top: -100px;
  z-index: 30;
  background: var(--panel);
  padding: 10px;
}
.skip:focus {
  top: 10px;
}
kbd {
  background: var(--soft);
  padding: 2px 6px;
  border-radius: 4px;
}
progress {
  width: 100%;
  accent-color: var(--accent);
}
@media (max-width: 1150px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  main {
    padding: 30px;
  }
  header {
    padding: 0 30px;
  }
}
@media (max-width: 800px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 18px;
    display: block;
  }
  .brand {
    font-size: 22px;
  }
  .search {
    margin: 18px 0 10px;
  }
  nav {
    display: flex;
    overflow-x: auto;
  }
  nav a {
    white-space: nowrap;
  }
  .side-bottom {
    display: none;
  }
  .workspace {
    margin-left: 0;
  }
  header {
    height: 60px;
    padding: 0 18px;
  }
  main {
    padding: 24px 18px;
  }
  .two,
  .layout {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 24px;
  }
  .grid {
    gap: 12px;
  }
  .card {
    padding: 18px;
  }
  .three {
    grid-template-columns: 1fr;
  }
  footer {
    margin: 15px 18px;
    display: block;
  }
  footer span {
    display: block;
  }
  .timer-digits {
    letter-spacing: -3px;
  }
  .row > input {
    flex: 1;
    min-width: 150px;
  }
  .fieldgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 440px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .fieldgrid {
    grid-template-columns: 1fr;
  }
  header #breadcrumb {
    max-width: 120px;
  }
  header .ghost {
    font-size: 11px;
    padding: 6px;
  }
  .panel {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.snapshot-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.snapshot-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.habit-day {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 700;
}
.habit-day.done {
  background: var(--accent);
  color: var(--panel);
  border-color: var(--accent);
}
.swatch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.swatch-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 440px) {
  .snapshot-grid {
    grid-template-columns: 1fr;
  }
}
