      :root {
        --bg: #f4f1ea;
        --card: #ffffff;
        --ink: #102a43;
        --muted: #486581;
        --accent: #0f766e;
        --accent-dark: #115e59;
        --danger: #b42318;
        --line: #d9e2ec;
        --tap-min: 44px;
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        font-family: "Avenir Next", "Segoe UI", sans-serif;
        color: var(--ink);
        background:
          radial-gradient(circle at 10% 0%, #d8f3dc 0, transparent 36%),
          radial-gradient(circle at 100% 100%, #e0ecff 0, transparent 38%),
          var(--bg);
        min-height: 100vh;
      }

      .wrap {
        max-width: 960px;
        margin: 2.2rem auto;
        padding: 0 1rem 2rem;
      }

      .page-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
      }

      .header-actions button {
        width: auto;
        min-width: 110px;
      }

      h1 {
        margin: 0 0 0.45rem;
        font-size: clamp(1.8rem, 4vw, 2.5rem);
      }

      .subtitle {
        margin: 0 0 0.45rem;
        color: var(--muted);
      }

      .top-links {
        margin-top: 0.75rem;
      }

      .top-links a {
        color: var(--ink);
      }

      .grid {
        display: grid;
        gap: 1rem;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        margin-top: 1rem;
      }

      .card {
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 16px;
        padding: 1rem;
        box-shadow: 0 8px 26px rgba(16, 42, 67, 0.07);
      }

      label {
        display: block;
        font-size: 0.9rem;
        color: var(--muted);
        margin-bottom: 0.35rem;
      }

      input,
      button {
        width: 100%;
        font: inherit;
        border-radius: 10px;
      }

      input {
        padding: 0.6rem 0.75rem;
        border: 1px solid var(--line);
        margin-bottom: 0.75rem;
        font-size: 16px;
      }

      button {
        border: 0;
        color: #fff;
        background: var(--accent);
        padding: 0.65rem 0.85rem;
        min-height: var(--tap-min);
        cursor: pointer;
        transition: background 120ms ease;
      }

      button:hover {
        background: var(--accent-dark);
      }

      .button-secondary {
        background: #627d98;
      }

      .button-secondary:hover {
        background: #486581;
      }

      .button-danger {
        background: var(--danger);
      }

      .button-danger:hover {
        background: #912018;
      }

      ul {
        padding-left: 1rem;
        margin: 0.75rem 0 0;
      }

      li {
        margin-bottom: 0.35rem;
      }

      .status {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 50;
        max-width: min(92vw, 420px);
        padding: 0.65rem 0.8rem;
        border-radius: 10px;
        border: 1px solid var(--line);
        background: #f8fbff;
        color: var(--muted);
        box-shadow: 0 8px 24px rgba(16, 42, 67, 0.12);
      }

      .status.error {
        background: #fff5f5;
        border-color: #f8d7da;
        color: #9b2226;
      }

      .status.hidden {
        display: none;
      }

      .auth-status {
        margin-top: 0.75rem;
        padding: 0.55rem 0.65rem;
        border-radius: 8px;
        border: 1px solid var(--line);
        background: #f8fbff;
        color: var(--muted);
        font-size: 0.92rem;
      }

      .auth-status.error {
        background: #fff5f5;
        border-color: #f8d7da;
        color: #9b2226;
      }

      .auth-status.hidden {
        display: none;
      }

      .user-badge {
        margin-top: 0.75rem;
        padding: 0.65rem 0.75rem;
        border-radius: 10px;
        border: 1px solid var(--line);
        background: #f8fbff;
        color: var(--muted);
      }

      .row {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 0.6rem;
      }

      .app-grid {
        align-items: start;
      }

      .list-stack {
        display: grid;
        gap: 0.6rem;
        margin-top: 0.9rem;
      }

      .list-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.7rem;
        padding: 0.7rem;
        min-height: 52px;
        border: 1px solid var(--line);
        border-radius: 10px;
        cursor: pointer;
      }

      .list-row.active {
        border-color: var(--accent);
        background: #f0fdf9;
      }

      .list-title {
        flex: 1;
        font-weight: 600;
      }

      .list-actions {
        display: flex;
        gap: 0.4rem;
      }

      .list-actions button {
        width: auto;
        min-width: 74px;
        padding: 0.45rem 0.55rem;
      }

      .items-list {
        list-style: none;
        padding-left: 0;
      }

      .item-row {
        display: grid;
        grid-template-columns: auto 1fr auto auto;
        grid-template-areas: "handle text toggle more";
        gap: 0.55rem;
        align-items: center;
        padding: 0.6rem;
        border: 1px solid var(--line);
        border-radius: 10px;
      }

      .item-row.dragging {
        opacity: 0.5;
      }

      .touch-dragging,
      .touch-dragging * {
        user-select: none;
        -webkit-user-select: none;
      }

      .drag-handle {
        grid-area: handle;
        color: var(--muted);
        cursor: grab;
        user-select: none;
        touch-action: none;
        font-size: 1rem;
        letter-spacing: -1px;
      }

      .item-text {
        grid-area: text;
        min-width: 0;
        overflow-wrap: anywhere;
      }

      .item-text.done {
        color: var(--muted);
        text-decoration: line-through;
      }

      .done-btn {
        grid-area: toggle;
        width: auto;
        min-width: 74px;
        padding: 0.45rem 0.55rem;
      }

      .done-btn.done {
        background: #486581;
      }

      .item-more {
        grid-area: more;
        position: relative;
      }

      .item-more summary {
        list-style: none;
        width: 38px;
        height: 38px;
        border-radius: 8px;
        border: 0;
        background: #627d98;
        color: #fff;
        cursor: pointer;
        display: grid;
        place-items: center;
        font-size: 1.2rem;
        line-height: 1;
      }

      .item-more summary:hover {
        background: #486581;
      }

      .item-more summary::-webkit-details-marker {
        display: none;
      }

      .more-menu {
        position: absolute;
        right: 0;
        top: calc(100% + 0.45rem);
        z-index: 10;
        min-width: 180px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 10px 24px rgba(16, 42, 67, 0.14);
        padding: 0.55rem;
        display: grid;
        gap: 0.5rem;
      }

      .more-menu button {
        width: 100%;
        padding: 0.5rem;
      }

      .more-move {
        display: grid;
        gap: 0.4rem;
      }

      .more-move select {
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 0.4rem;
        background: #fff;
      }

      .hidden {
        display: none;
      }

      @media (max-width: 720px) {
        .wrap {
          margin: 1rem auto;
          padding: 0 0.75rem 1.25rem;
        }

        .card {
          padding: 0.85rem;
          border-radius: 14px;
        }

        .page-header {
          flex-direction: column;
          align-items: stretch;
          gap: 0.65rem;
        }

        .header-actions button {
          width: 100%;
        }

        .status {
          display: none !important;
        }

        .row {
          grid-template-columns: 1fr;
        }

        .app-grid {
          gap: 0.75rem;
        }

        .list-row {
          flex-direction: column;
          align-items: stretch;
          gap: 0.6rem;
          padding: 0.75rem;
        }

        .list-actions {
          width: 100%;
        }

        .list-actions button {
          flex: 1;
          min-height: var(--tap-min);
        }

        #itemsControls {
          position: sticky;
          bottom: max(0.5rem, env(safe-area-inset-bottom));
          z-index: 20;
          margin-top: 0.75rem;
          padding: 0.65rem;
          border: 1px solid var(--line);
          border-radius: 12px;
          background: rgba(255, 255, 255, 0.98);
          box-shadow: 0 8px 20px rgba(16, 42, 67, 0.14);
          backdrop-filter: blur(4px);
        }

        #items {
          padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
        }

        .item-row {
          grid-template-columns: auto 1fr auto;
          grid-template-areas:
            "handle text more"
            "toggle toggle toggle";
          align-items: center;
          padding: 0.72rem;
        }

        .drag-handle {
          min-width: var(--tap-min);
          min-height: var(--tap-min);
          display: grid;
          place-items: center;
          font-size: 1.2rem;
          line-height: 1;
        }

        .done-btn {
          width: 100%;
          min-height: var(--tap-min);
        }

        .item-more summary {
          width: var(--tap-min);
          height: var(--tap-min);
        }

        .item-more[open] .more-menu {
          position: fixed;
          left: 0.75rem;
          right: 0.75rem;
          top: auto;
          bottom: max(0.75rem, env(safe-area-inset-bottom));
          min-width: 0;
          max-height: 55vh;
          overflow: auto;
          z-index: 60;
        }
      }
