﻿    .options-menu {
      position: absolute;
      top: 66px;
      right: 16px;
      z-index: 16;
      width: 190px;
      border-radius: 20px;
      padding: 8px;
      background: var(--panel);
      box-shadow: var(--shadow);
      display: none;
    }

    .options-menu.open { display: block; }

    .account-menu {
      right: 56px;
    }

    .account-info-body {
      display: grid;
      gap: 10px;
      margin-top: 16px;
    }

    .account-info-body p {
      margin: 0;
      min-height: 48px;
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 13px 14px;
      background: #f4f6f1;
      color: var(--text);
      font-size: 14px;
      font-weight: 800;
      line-height: 1.35;
    }

    .options-menu button {
      width: 100%;
      min-height: 44px;
      border-radius: 14px;
      text-align: left;
      padding: 0 12px;
      font-weight: 800;
    }

    .options-menu button:hover { background: #f1f5ee; }

    .settings-modal {
      position: absolute;
      inset: 0;
      z-index: 28;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
      background: rgba(31, 39, 31, .28);
    }

    .settings-modal.open { display: flex; }

    .settings-dialog {
      width: 100%;
      border-radius: var(--radius);
      background: var(--panel);
      box-shadow: 0 20px 55px rgba(20, 40, 25, .22);
      padding: 16px;
    }

    .settings-header {
      display: grid;
      grid-template-columns: 38px 1fr 38px;
      align-items: center;
      gap: 8px;
    }

    .settings-header strong {
      text-align: center;
      font-size: 18px;
      font-weight: 900;
    }

    .settings-close {
      width: 38px;
      height: 38px;
      border-radius: 999px;
      background: #f1f5ee;
      color: var(--muted);
      font-weight: 900;
    }

    .threshold-options {
      margin-top: 16px;
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }

    .threshold-options button {
      min-height: 54px;
      border-radius: 16px;
      background: #f4f6f1;
      font-size: 17px;
      font-weight: 900;
    }

    .threshold-options button.selected {
      background: var(--green);
      color: white;
    }

    .settings-primary {
      width: 100%;
      min-height: 52px;
      margin-top: 14px;
      border-radius: 18px;
      background: var(--green);
      color: white;
      font-size: 16px;
      font-weight: 900;
    }

    .settings-primary:disabled {
      background: var(--gray);
      color: var(--muted);
      cursor: default;
    }

    .settings-secondary {
      width: 100%;
      min-height: 52px;
      margin-top: 14px;
      border-radius: 18px;
      background: #f1f5ee;
      color: var(--muted);
      font-size: 16px;
      font-weight: 900;
    }

    .archive-dialog {
      max-height: calc(100% - 32px);
      display: flex;
      flex-direction: column;
    }

    .archive-subtitle {
      margin-top: 10px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
      text-align: center;
    }

    .archive-list {
      margin-top: 12px;
      max-height: min(420px, 62vh);
      overflow-y: auto;
      padding-bottom: 4px;
    }

    .archive-list .task-row {
      grid-template-columns: 2fr 7fr 1fr;
    }

    .archive-empty {
      min-height: 84px;
      border-radius: 18px;
      background: #f4f6f1;
      color: var(--muted);
      display: grid;
      place-items: center;
      font-weight: 900;
    }

    .rest-range-row {
      margin-top: 16px;
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 8px;
    }

    .rest-range-row button {
      min-height: 58px;
      border-radius: 16px;
      background: #f4f6f1;
      padding: 0 10px;
      font-size: 13px;
      font-weight: 900;
      line-height: 1.35;
    }

    .rest-range-row span {
      color: var(--muted);
      font-weight: 900;
    }

    .rest-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    #restCalendarGrid button.in-range {
      border-radius: 0;
      background: rgba(97, 195, 139, .34);
      color: var(--green-dark);
    }

    #restCalendarGrid button.range-start {
      border-radius: 14px 0 0 14px;
      background: var(--green);
      color: white;
    }

    #restCalendarGrid button.range-end {
      border-radius: 0 14px 14px 0;
      background: var(--green);
      color: white;
    }

    #restCalendarGrid button.range-start.range-end {
      border-radius: 14px;
    }

    body.dark-mode .app-shell,
    body.dark-mode .phone-frame {
      background: var(--bg);
    }

    body.dark-mode .task-row {
      background: #252b24;
    }

    body.dark-mode .segmented-wrap {
      background: #30372e;
    }

    body.dark-mode .routine-tab-icon,
    body.dark-mode .calendar-arrow,
    body.dark-mode .calendar-today,
    body.dark-mode .calendar-close,
    body.dark-mode .settings-close,
    body.dark-mode .confirm-secondary,
    body.dark-mode .settings-secondary,
    body.dark-mode .calendar-grid button,
    body.dark-mode .threshold-options button,
    body.dark-mode .rest-range-row button {
      background: #30372e;
      color: var(--muted);
    }

    body.dark-mode .archive-empty {
      background: #30372e;
    }

    body.dark-mode .account-info-body p {
      background: #30372e;
    }

    body.dark-mode .bottom-nav {
      background: rgba(32, 37, 31, .94);
    }

    body.dark-mode .nav-button.active {
      background: #2d4435;
      color: #8ee0ae;
    }
