:root{--brand-yellow:#febe01}

    :root {
      color-scheme: dark;
      --bg: #0b0d10;
      --panel: #171a20;
      --line: #2b303a;
      --text: #f5f6f8;
      --muted: #b0b7c4;
      --yellow: var(--brand-yellow);
      --blue: #8bbaff;
      --green: #83e6b2;
      --violet: #c8a8ff;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 17px;
      line-height: 1.5;
      -webkit-tap-highlight-color: transparent;
    }

    button, input { font: inherit; }
    button, summary, label { touch-action: manipulation; }
    button, summary { cursor: pointer; }
    button { border: 0; }

    :focus-visible {
      outline: 3px solid var(--yellow);
      outline-offset: 5px;
    }

    [hidden] { display: none !important; }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
      border: 0;
    }

    .app {
      max-width: 540px;
      margin: auto;
      padding: max(28px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
    }

    .topline {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .mark {
      display: grid;
      place-items: center;
      width: 36px;
      height: 36px;
      border-radius: 12px;
      background: var(--yellow);
      color: var(--bg);
      font-size: 23px;
      font-weight: 800;
    }

    .eyebrow {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 1.7px;
    }

    h1 {
      margin: 22px 0 10px;
      font-size: clamp(42px, 12vw, 56px);
      line-height: 1.06;
      letter-spacing: -2px;
      font-weight: 800;
    }

    h1 span { color: var(--yellow); }

    .intro {
      margin: 0 0 26px;
      color: var(--muted);
    }

    h2 {
      margin: 0;
      font-size: 21px;
      line-height: 1.3;
      letter-spacing: -.4px;
    }

    .overview {
      padding: 22px;
      border: 1px solid #363d2d;
      border-radius: 24px;
      background: linear-gradient(130deg, #24291b, #171b1d 75%);
    }

    .section-line {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
    }

    .overview h2 {
      font-size: 17px;
      font-weight: 600;
    }

    .count {
      color: var(--muted);
      font-size: 15px;
      font-variant-numeric: tabular-nums;
    }

    .big-number {
      margin: 10px 0 14px;
      color: var(--yellow);
      line-height: 1;
    }

    #total-percent {
      font-size: 76px;
      font-weight: 800;
      letter-spacing: -5px;
    }

    .percent-sign {
      margin-left: 5px;
      font-size: 34px;
      font-weight: 700;
    }

    progress {
      display: block;
      width: 100%;
      height: 16px;
      overflow: hidden;
      appearance: none;
      -webkit-appearance: none;
      border: 1px solid #566170;
      border-radius: 99px;
      background: #343e4b;
      color: var(--accent, var(--yellow));
      accent-color: var(--accent, var(--yellow));
    }

    progress::-webkit-progress-bar {
      background: #343e4b;
      border-radius: 99px;
    }

    progress::-webkit-progress-value {
      background: var(--accent, var(--yellow));
      border-radius: 99px;
      transition: width .25s ease;
    }

    progress::-moz-progress-bar {
      background: var(--accent, var(--yellow));
      border-radius: 99px;
    }

    #total-progress { height: 40px; }

    .encouragement {
      margin: 14px 0 0;
      color: #d6dccd;
      font-size: 15px;
    }

    .category-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 9px;
      margin: 14px 0 24px;
    }

    .work { --accent: var(--blue); --tint: #1b293d; }
    .home { --accent: var(--green); --tint: #193128; }
    .personal { --accent: var(--violet); --tint: #2c233c; }

    .category-card {
      min-width: 0;
      padding: 14px 12px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--panel);
    }

    .category-card h3 {
      margin: 0 0 10px;
      color: var(--accent);
      font-size: 15px;
      font-weight: 650;
    }

    .category-percent {
      display: block;
      margin-bottom: 9px;
      font-size: 23px;
      font-weight: 750;
      line-height: 1.2;
    }

    .category-count {
      display: block;
      margin-top: 8px;
      color: var(--muted);
      font-size: 14px;
    }

    .composer {
      margin-bottom: 30px;
      border-radius: 18px;
    }

    .composer summary {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      min-height: 58px;
      padding: 14px 18px;
      border-radius: 16px;
      border: 1px solid var(--yellow);
      background: var(--panel);
      color: var(--yellow);
      font-size: 18px;
      font-weight: 750;
      list-style: none;
    }

    .composer summary::-webkit-details-marker { display: none; }

    .plus {
      font-size: 27px;
      line-height: 1;
      transition: transform .2s;
    }

    .composer[open] .plus { transform: rotate(45deg); }

    form {
      margin-top: 12px;
      padding: 18px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--panel);
    }

    .field-label, legend {
      display: block;
      margin-bottom: 9px;
      font-size: 16px;
      font-weight: 650;
    }

    #task-title {
      width: 100%;
      min-height: 56px;
      padding: 13px 14px;
      border: 1px solid #515866;
      border-radius: 12px;
      background: var(--bg);
      color: var(--text);
      font-size: 17px;
    }

    #task-title::placeholder { color: #929baa; }

    .error {
      margin: 8px 0 0;
      color: #ffb4ab;
      font-size: 15px;
    }

    fieldset {
      min-width: 0;
      margin: 20px 0;
      padding: 0;
      border: 0;
    }

    legend { padding: 0; }

    .choices {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .choice {
      position: relative;
      cursor: pointer;
    }

    .choice span {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 50px;
      padding: 8px 4px;
      border: 2px solid var(--line);
      border-radius: 12px;
      color: var(--accent);
      font-size: 15px;
      font-weight: 650;
    }

    .choice input:checked + span {
      border-color: var(--accent);
      background: var(--tint);
    }

    .choice input:focus-visible + span {
      outline: 3px solid var(--yellow);
      outline-offset: 3px;
    }

    .submit {
      width: 100%;
      min-height: 54px;
      padding: 12px;
      border-radius: 12px;
      background: var(--yellow);
      color: #11150b;
      font-weight: 750;
    }

    .list-header { margin-bottom: 6px; }

    .list-hint {
      margin: 0 0 18px;
      color: var(--muted);
      font-size: 15px;
    }

    .task-list {
      display: grid;
      gap: 12px;
      padding: 0;
      margin: 0;
      list-style: none;
    }

    .task {
      overflow: hidden;
      border: 1px solid var(--line);
      border-left: 3px solid var(--accent);
      border-radius: 18px;
      background: var(--panel);
    }

    .task-control {
      display: flex;
      align-items: center;
      gap: 15px;
      min-height: 98px;
      padding: 18px;
      cursor: pointer;
    }

    .tick {
      position: relative;
      flex: 0 0 30px;
      height: 30px;
      border: 2px solid #717b8c;
      border-radius: 10px;
    }

    .tick::after {
      content: "";
      position: absolute;
      left: 9px;
      top: 4px;
      width: 7px;
      height: 13px;
      border: solid #11150b;
      border-width: 0 3px 3px 0;
      transform: rotate(45deg);
      opacity: 0;
    }

    .task-control input:checked + .tick {
      background: var(--yellow);
      border-color: var(--yellow);
    }

    .task-control input:checked + .tick::after { opacity: 1; }

    .task-control input:focus-visible + .tick {
      outline: 3px solid var(--yellow);
      outline-offset: 4px;
    }

    .task-text { min-width: 0; }

    .task-title {
      display: block;
      font-size: 18px;
      font-weight: 600;
      line-height: 1.4;
      overflow-wrap: anywhere;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 7px;
      color: var(--accent);
      font-size: 14px;
    }

    .badge::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: currentColor;
    }

    .task.done .task-title {
      color: #b7bfcc;
      text-decoration: line-through;
      text-decoration-thickness: 1.5px;
    }

    .empty {
      padding: 28px 20px;
      border: 1px dashed #515866;
      border-radius: 18px;
      text-align: center;
      color: var(--muted);
    }

    .empty strong {
      display: block;
      margin-bottom: 8px;
      color: var(--text);
      font-size: 20px;
    }

    .storage-note {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
      margin: 28px 0 0;
      color: var(--muted);
      font-size: 13px;
      text-align: center;
    }

    .storage-note svg { flex: 0 0 15px; }

    .privacy {
      margin: 6px 0 0;
      color: var(--muted);
      font-size: 13px;
      text-align: center;
    }

    .warning {
      padding: 14px 16px;
      margin: 0 0 20px;
      border: 1px solid #806f3c;
      border-radius: 14px;
      background: #302b1b;
      color: #ffebae;
      font-size: 15px;
    }

    .primary, .secondary {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: 100%;
      min-height: 58px;
      padding: 14px 18px;
      border: 1px solid var(--yellow);
      border-radius: 16px;
      font-size: 18px;
      font-weight: 750;
      line-height: 1.3;
    }

    .primary {
      background: var(--yellow);
      color: #11150b;
    }

    .secondary {
      background: var(--panel);
      color: var(--yellow);
    }

    button:disabled {
      cursor: default;
      opacity: .5;
    }

    #start-focus { margin-bottom: 12px; }
    .focus-toolbar { margin-bottom: 14px; }

    .back-button {
      width: auto;
      min-height: 48px;
      padding: 10px 14px;
      font-size: 15px;
    }

    .focus-topline { margin-bottom: 12px; }
    .focus-topline .eyebrow { letter-spacing: 1px; }

    .focus-card {
      padding: 22px;
      border: 1px solid var(--accent);
      border-left-width: 4px;
      border-radius: 22px;
      background: var(--panel);
    }

    .focus-card .badge {
      margin: 0 0 14px;
      font-size: 16px;
    }

    #focus-title {
      font-size: clamp(26px, 8vw, 34px);
      line-height: 1.2;
      letter-spacing: -.7px;
      overflow-wrap: anywhere;
    }

    .focus-actions {
      display: grid;
      gap: 12px;
      margin-top: 18px;
    }

    #complete-focus {
      min-height: 68px;
      font-size: 20px;
    }

    #focus-help {
      margin: 14px 0 0;
      color: var(--muted);
      font-size: 15px;
    }

    .finish-card {
      padding: 28px 22px;
      border: 1px solid #62501c;
      border-radius: 24px;
      background: #201f15;
      text-align: center;
    }

    .finish-symbol {
      display: grid;
      place-items: center;
      width: 76px;
      height: 76px;
      margin: 0 auto 20px;
      border-radius: 50%;
      background: var(--yellow);
      color: #11150b;
      font-size: 42px;
      font-weight: 800;
    }

    #finished-title { font-size: 32px; }

    #finished-detail {
      margin: 14px 0 24px;
      color: #d6dccd;
    }

    .is-focusing .topline,
    .is-focusing .intro {
      display: none;
    }

    .is-focusing h1 {
      margin: 0 0 16px;
      font-size: 26px;
      line-height: 1.2;
      letter-spacing: -.8px;
    }

    .is-focusing h1 br { display: none; }
    .is-focusing .overview { padding: 16px 18px; }

    .is-focusing #total-percent {
      font-size: 48px;
      letter-spacing: -2px;
    }

    .is-focusing .big-number { margin: 8px 0 12px; }
    .is-focusing .percent-sign { font-size: 26px; }
    .is-focusing .encouragement { display: none; }
    .is-focusing .category-card { padding: 12px 10px; }
    .is-focusing .category-card h3 { margin-bottom: 6px; }

    .is-focusing .category-percent {
      font-size: 20px;
      margin-bottom: 8px;
    }

    .is-focusing .category-grid { margin-bottom: 22px; }

    @media (max-width: 350px) {
      .app { padding-left: 16px; padding-right: 16px; }
      .category-card { padding: 12px 9px; }
      form { padding: 14px; }
      .choices { gap: 5px; }
      .choice span { font-size: 14px; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        transition: none !important;
      }
    }
  