:root {
      --bg: #f5f6fb;
      --panel: rgba(255,255,255,.9);
      --panel-solid: #ffffff;
      --panel-2: #f0f2f8;
      --text: #181a23;
      --muted: #6f7485;
      --line: #e3e6ef;
      --primary: #6f5cff;
      --primary-2: #8b7cff;
      --primary-soft: #eeeaff;
      --success: #16a36a;
      --warning: #e59b18;
      --danger: #dc4c64;
      --info: #2786e8;
      --shadow: 0 18px 55px rgba(37, 42, 64, .10);
      --radius: 22px;
      --radius-sm: 14px;
      --sidebar: 256px;
      --topbar: 72px;
    }

    html[data-theme="dark"] {
      --bg: #101117;
      --panel: rgba(26,28,38,.90);
      --panel-solid: #1a1c26;
      --panel-2: #232633;
      --text: #f5f6fb;
      --muted: #a3a8ba;
      --line: #303342;
      --primary: #8a79ff;
      --primary-2: #a89cff;
      --primary-soft: #2a2549;
      --success: #39c887;
      --warning: #f3b84b;
      --danger: #ff7188;
      --info: #61a9f2;
      --shadow: 0 18px 55px rgba(0,0,0,.32);
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      min-height: 100vh;
      background:
        radial-gradient(circle at 85% 8%, rgba(111,92,255,.16), transparent 27%),
        radial-gradient(circle at 8% 90%, rgba(39,134,232,.10), transparent 24%),
        var(--bg);
      color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
      letter-spacing: .01em;
    }

    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    a { color: inherit; }
    .hidden { display: none !important; }
    .muted { color: var(--muted); }
    .nowrap { white-space: nowrap; }

    .app-shell { min-height: 100vh; }
    .sidebar {
      position: fixed;
      inset: 0 auto 0 0;
      width: var(--sidebar);
      padding: 24px 18px;
      background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
      border-right: 1px solid var(--line);
      backdrop-filter: blur(18px);
      z-index: 30;
      display: flex;
      flex-direction: column;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 4px 8px 24px;
    }
    .brand-mark {
      width: 44px;
      height: 44px;
      border-radius: 15px;
      display: grid;
      place-items: center;
      color: white;
      font-weight: 800;
      font-size: 18px;
      background: linear-gradient(145deg, var(--primary), var(--primary-2));
      box-shadow: 0 10px 24px rgba(111,92,255,.28);
    }
    .brand-text strong { display: block; font-size: 18px; }
    .brand-text span { color: var(--muted); font-size: 12px; }

    .nav { display: grid; gap: 7px; }
    .nav-btn {
      width: 100%;
      border: 0;
      background: transparent;
      color: var(--muted);
      padding: 12px 13px;
      border-radius: 14px;
      display: flex;
      align-items: center;
      gap: 12px;
      text-align: left;
      transition: .2s ease;
    }
    .nav-btn:hover { background: var(--panel-2); color: var(--text); }
    .nav-btn.active {
      color: var(--primary);
      background: var(--primary-soft);
      font-weight: 700;
    }
    .nav-icon { width: 23px; text-align: center; font-size: 18px; }
    .sidebar-footer {
      margin-top: auto;
      padding: 14px;
      border-radius: 16px;
      background: var(--panel-2);
      color: var(--muted);
      font-size: 12px;
      line-height: 1.6;
    }

    .topbar {
      position: fixed;
      top: 0;
      left: var(--sidebar);
      right: 0;
      height: var(--topbar);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 0 30px;
      background: color-mix(in srgb, var(--bg) 76%, transparent);
      border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
      backdrop-filter: blur(18px);
      z-index: 20;
    }
    .topbar-title strong { display: block; font-size: 18px; }
    .topbar-title span { color: var(--muted); font-size: 12px; }
    .top-actions { display: flex; align-items: center; gap: 10px; }
    .timer-pill {
      display: none;
      align-items: center;
      gap: 9px;
      padding: 8px 12px;
      border-radius: 999px;
      background: var(--primary-soft);
      color: var(--primary);
      border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
      max-width: 300px;
    }
    .timer-pill.show { display: flex; }
    .timer-pill .task-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }

    .main {
      margin-left: var(--sidebar);
      padding: calc(var(--topbar) + 28px) 30px 52px;
      min-height: 100vh;
    }
    .page { display: none; max-width: 1440px; margin: 0 auto; animation: fade .22s ease; }
    .page.active { display: block; }
    @keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

    .page-head {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 18px;
      margin-bottom: 22px;
    }
    .page-head h1 { margin: 0 0 6px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; }
    .page-head p { margin: 0; color: var(--muted); }

    .card {
      background: var(--panel);
      border: 1px solid color-mix(in srgb, var(--line) 92%, transparent);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      backdrop-filter: blur(14px);
    }
    .card-pad { padding: 22px; }
    .card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
    }
    .card-head h2, .card-head h3 { margin: 0; }
    .card-head h2 { font-size: 19px; }
    .card-head h3 { font-size: 16px; }

    .hero {
      position: relative;
      overflow: hidden;
      min-height: 210px;
      padding: 28px;
      background:
        linear-gradient(120deg, rgba(111,92,255,.95), rgba(89,121,255,.82)),
        var(--panel-solid);
      color: white;
      border: 0;
      display: grid;
      grid-template-columns: 1.4fr .8fr;
      align-items: center;
      gap: 22px;
    }
    .hero::after {
      content: "";
      position: absolute;
      width: 270px;
      height: 270px;
      right: -60px;
      top: -90px;
      border-radius: 50%;
      border: 45px solid rgba(255,255,255,.10);
    }
    .hero h1 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.04em; }
    .hero p { max-width: 650px; margin: 0 0 22px; line-height: 1.7; color: rgba(255,255,255,.85); }
    .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
    .hero-stat {
      position: relative;
      z-index: 1;
      justify-self: end;
      width: min(100%, 300px);
      padding: 22px;
      border-radius: 20px;
      background: rgba(255,255,255,.14);
      border: 1px solid rgba(255,255,255,.22);
      backdrop-filter: blur(10px);
    }
    .hero-stat .label { font-size: 13px; opacity: .82; }
    .hero-stat .value { font-size: 42px; font-weight: 800; margin: 8px 0; }
    .hero-stat .sub { font-size: 13px; opacity: .82; }

    .btn {
      border: 1px solid transparent;
      border-radius: 13px;
      padding: 10px 15px;
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-weight: 700;
      transition: .2s ease;
      color: var(--text);
      background: var(--panel-2);
    }
    .btn:hover { transform: translateY(-1px); filter: brightness(1.02); }
    .btn:active { transform: translateY(0); }
    .btn-primary { background: var(--primary); color: white; box-shadow: 0 9px 22px rgba(111,92,255,.22); }
    .btn-secondary { background: var(--panel-solid); border-color: var(--line); }
    .btn-ghost { background: transparent; border-color: var(--line); }
    .btn-danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
    .btn-success { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
    .btn-light { background: white; color: #5e4ae8; }
    .btn-glass { color: white; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.24); }
    .icon-btn {
      width: 42px;
      height: 42px;
      padding: 0;
      border-radius: 13px;
      border: 1px solid var(--line);
      background: var(--panel);
      color: var(--text);
      display: grid;
      place-items: center;
    }
    .btn-sm { min-height: 34px; padding: 7px 11px; border-radius: 10px; font-size: 13px; }

    .grid { display: grid; gap: 18px; }
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .metrics { margin: 18px 0; }
    .metric-card { padding: 20px; }
    .metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .metric-icon {
      width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
      background: var(--primary-soft); color: var(--primary); font-size: 18px;
    }
    .metric-card .value { font-size: 30px; font-weight: 800; margin: 15px 0 4px; letter-spacing: -.03em; }
    .metric-card .label { color: var(--muted); font-size: 13px; }
    .metric-card .delta { font-size: 12px; color: var(--success); }

    .progress {
      height: 9px;
      border-radius: 999px;
      overflow: hidden;
      background: var(--panel-2);
    }
    .progress > span {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--primary), var(--primary-2));
      transition: width .35s ease;
    }

    .list { display: grid; gap: 10px; }
    .empty {
      padding: 30px 18px;
      border: 1px dashed var(--line);
      border-radius: 16px;
      text-align: center;
      color: var(--muted);
      line-height: 1.7;
    }
    .task-item, .goal-card, .mood-item, .review-item {
      border: 1px solid var(--line);
      background: color-mix(in srgb, var(--panel-solid) 74%, transparent);
      border-radius: 16px;
      padding: 14px;
    }
    .task-item {
      display: grid;
      grid-template-columns: auto 1fr auto;
      align-items: center;
      gap: 13px;
    }
    .task-check {
      width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line);
      background: transparent; color: white; display: grid; place-items: center; padding: 0;
    }
    .task-item.done { opacity: .65; }
    .task-item.done .task-check { background: var(--success); border-color: var(--success); }
    .task-item.done .task-title { text-decoration: line-through; }
    .task-title { font-weight: 750; margin-bottom: 5px; overflow-wrap: anywhere; }
    .task-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 12px; }
    .task-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }

    .tag {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 5px 8px;
      border-radius: 999px;
      background: var(--panel-2);
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
    }
    .tag.high { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
    .tag.medium { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
    .tag.low { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }

    .focus-box {
      padding: 22px;
      border-radius: 20px;
      background: linear-gradient(135deg, var(--panel-2), color-mix(in srgb, var(--primary-soft) 70%, var(--panel-solid)));
      border: 1px solid var(--line);
      text-align: center;
    }
    .focus-time { font-size: clamp(48px, 7vw, 76px); font-weight: 850; letter-spacing: -.06em; margin: 16px 0 4px; }
    .focus-name { color: var(--muted); min-height: 24px; }
    .focus-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

    .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .field { display: grid; gap: 7px; }
    .field.full { grid-column: 1 / -1; }
    .field label { font-size: 13px; color: var(--muted); font-weight: 650; }
    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      background: var(--panel-solid);
      color: var(--text);
      border-radius: 12px;
      padding: 11px 12px;
      outline: none;
      transition: border .2s, box-shadow .2s;
    }
    input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
    textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
    input[type="range"] { padding: 0; accent-color: var(--primary); }

    .toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
    .toolbar .spacer { flex: 1; }
    .segmented {
      display: inline-flex;
      padding: 4px;
      border: 1px solid var(--line);
      background: var(--panel-2);
      border-radius: 13px;
      gap: 3px;
    }
    .segment {
      border: 0;
      background: transparent;
      color: var(--muted);
      padding: 8px 12px;
      border-radius: 9px;
      font-size: 13px;
      font-weight: 700;
    }
    .segment.active { background: var(--panel-solid); color: var(--primary); box-shadow: 0 3px 10px rgba(0,0,0,.06); }

    .goal-card { display: grid; gap: 11px; }
    .goal-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
    .goal-card h3 { margin: 0 0 5px; font-size: 16px; }
    .goal-meta { color: var(--muted); font-size: 12px; }
    .goal-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .goal-actions input[type="range"] { max-width: 190px; }

    .schedule {
      position: relative;
      display: grid;
      gap: 0;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 16px;
    }
    .schedule-row {
      min-height: 54px;
      display: grid;
      grid-template-columns: 72px 1fr;
      border-bottom: 1px solid var(--line);
      background: color-mix(in srgb, var(--panel-solid) 76%, transparent);
    }
    .schedule-row:last-child { border-bottom: 0; }
    .schedule-time { padding: 11px; color: var(--muted); font-size: 12px; border-right: 1px solid var(--line); }
    .schedule-slot { padding: 7px 10px; display: flex; flex-wrap: wrap; gap: 7px; align-items: flex-start; }
    .schedule-task { padding: 6px 9px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; }

    .mood-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
    .mood-btn {
      border: 1px solid var(--line); background: var(--panel-solid); color: var(--muted);
      min-height: 44px; border-radius: 12px; font-weight: 800;
    }
    .mood-btn.active { color: white; background: var(--primary); border-color: var(--primary); transform: translateY(-2px); }
    .emotion-chips { display: flex; flex-wrap: wrap; gap: 8px; }
    .emotion-chip {
      border: 1px solid var(--line); background: var(--panel-solid); color: var(--muted);
      border-radius: 999px; padding: 8px 11px;
    }
    .emotion-chip.active { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, transparent); font-weight: 700; }
    .range-row { display: grid; grid-template-columns: 80px 1fr 32px; gap: 10px; align-items: center; }
    .range-value { font-weight: 800; color: var(--primary); text-align: right; }
    .mood-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
    .mood-score {
      width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
      background: var(--primary-soft); color: var(--primary); font-size: 18px; font-weight: 850;
    }
    .mood-item h4 { margin: 0 0 6px; }
    .mood-item p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

    .review-summary {
      padding: 16px;
      border-radius: 16px;
      background: var(--primary-soft);
      color: var(--text);
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      margin-bottom: 16px;
    }
    .review-summary div { text-align: center; }
    .review-summary strong { display: block; color: var(--primary); font-size: 20px; }
    .review-summary span { font-size: 11px; color: var(--muted); }
    .review-form .field { margin-bottom: 14px; }
    .review-item h4 { margin: 0 0 7px; }
    .review-item .date { color: var(--muted); font-size: 12px; }
    .review-preview { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 8px; white-space: pre-line; }

    .chart-card { min-height: 350px; }
    .chart-wrap { height: 270px; position: relative; }
    canvas { width: 100%; height: 100%; display: block; }
    .insight-text {
      line-height: 1.8;
      padding: 18px;
      border-radius: 16px;
      background: var(--panel-2);
      color: var(--muted);
    }
    .insight-text strong { color: var(--text); }

    .data-action {
      display: flex; align-items: center; justify-content: space-between; gap: 16px;
      padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-solid);
    }
    .data-action h3 { margin: 0 0 5px; font-size: 16px; }
    .data-action p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

    dialog {
      width: min(680px, calc(100% - 28px));
      max-height: calc(100vh - 36px);
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 22px;
      padding: 0;
      background: var(--panel-solid);
      color: var(--text);
      box-shadow: 0 28px 90px rgba(0,0,0,.28);
    }
    dialog::backdrop { background: rgba(10,12,20,.52); backdrop-filter: blur(5px); }
    .dialog-head { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
    .dialog-head h2 { margin: 0; font-size: 19px; }
    .dialog-body { padding: 22px; }
    .dialog-foot { padding: 16px 22px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }

    .toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 10px; }
    .toast {
      min-width: 260px; max-width: 380px; padding: 13px 15px; border-radius: 14px;
      background: var(--panel-solid); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow);
      animation: toastin .25s ease;
    }
    @keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

    .mobile-nav { display: none; }

    @media (max-width: 1100px) {
      .grid-4 { grid-template-columns: repeat(2, 1fr); }
      .grid-3 { grid-template-columns: repeat(2, 1fr); }
      .hero { grid-template-columns: 1fr; }
      .hero-stat { justify-self: start; }
    }

    @media (max-width: 820px) {
      :root { --topbar: 62px; }
      .sidebar { display: none; }
      .topbar { left: 0; padding: 0 16px; }
      .main { margin-left: 0; padding: calc(var(--topbar) + 18px) 14px 92px; }
      .topbar-title span { display: none; }
      .timer-pill .task-name { display: none; }
      .mobile-nav {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        position: fixed;
        left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 40;
        padding: 7px;
        border-radius: 20px;
        border: 1px solid var(--line);
        background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
        box-shadow: var(--shadow);
        backdrop-filter: blur(18px);
      }
      .mobile-nav .nav-btn { padding: 8px 4px; display: grid; place-items: center; gap: 2px; font-size: 10px; border-radius: 13px; }
      .mobile-nav .nav-icon { font-size: 18px; }
      .grid-2, .grid-3 { grid-template-columns: 1fr; }
      .page-head { align-items: flex-start; flex-direction: column; }
      .hero { padding: 22px; min-height: auto; }
      .hero-stat { width: 100%; }
      .review-summary { grid-template-columns: repeat(2, 1fr); }
      .form-grid { grid-template-columns: 1fr; }
      .field.full { grid-column: auto; }
    }

    @media (max-width: 540px) {
      .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
      .metric-card { padding: 15px; }
      .metric-card .value { font-size: 24px; }
      .metric-icon { width: 36px; height: 36px; }
      .card-pad { padding: 16px; }
      .task-item { grid-template-columns: auto 1fr; }
      .task-actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 37px; }
      .mood-scale { grid-template-columns: repeat(5, 1fr); }
      .mood-item { grid-template-columns: auto 1fr; }
      .mood-item > .icon-btn { grid-column: 2; }
      .data-action { align-items: flex-start; flex-direction: column; }
      .data-action .btn { width: 100%; }
      .topbar-title strong { font-size: 15px; }
      .top-actions { gap: 6px; }
      .icon-btn { width: 38px; height: 38px; }
      .timer-pill { padding: 7px 9px; }
    }

    /* Cloud-ready / account sync UI */
    .sync-pill {
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 11px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--panel-solid);
      color: var(--muted);
      box-shadow: 0 7px 22px rgba(37, 42, 64, .06);
      transition: .2s ease;
    }
    .sync-pill:hover { color: var(--text); transform: translateY(-1px); }
    .sync-dot {
      width: 8px;
      height: 8px;
      flex: 0 0 8px;
      border-radius: 50%;
      background: var(--muted);
      box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 12%, transparent);
    }
    .sync-pill[data-status="synced"] { color: var(--success); border-color: color-mix(in srgb, var(--success) 34%, var(--line)); }
    .sync-pill[data-status="synced"] .sync-dot { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent); }
    .sync-pill[data-status="syncing"], .sync-pill[data-status="connecting"] { color: var(--primary); }
    .sync-pill[data-status="syncing"] .sync-dot, .sync-pill[data-status="connecting"] .sync-dot {
      background: var(--primary);
      animation: syncpulse 1.15s ease-in-out infinite;
    }
    .sync-pill[data-status="pending"] { color: var(--warning); }
    .sync-pill[data-status="pending"] .sync-dot { background: var(--warning); }
    .sync-pill[data-status="offline"], .sync-pill[data-status="unavailable"], .sync-pill[data-status="error"], .sync-pill[data-status="conflict"] { color: var(--danger); }
    .sync-pill[data-status="offline"] .sync-dot, .sync-pill[data-status="unavailable"] .sync-dot,
    .sync-pill[data-status="error"] .sync-dot, .sync-pill[data-status="conflict"] .sync-dot { background: var(--danger); }
    @keyframes syncpulse { 50% { opacity: .35; transform: scale(.72); } }

    .cloud-card { grid-column: 1 / -1; }
    .cloud-status-panel {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 15px 16px;
      border-radius: 16px;
      border: 1px solid var(--line);
      background: var(--panel-2);
    }
    .cloud-status-panel strong { display: block; margin-bottom: 4px; }
    .cloud-status-panel p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
    .cloud-status-icon { color: var(--muted); line-height: 1.4; }
    .cloud-status-panel[data-status="synced"] { background: color-mix(in srgb, var(--success) 9%, var(--panel-solid)); border-color: color-mix(in srgb, var(--success) 28%, var(--line)); }
    .cloud-status-panel[data-status="synced"] .cloud-status-icon { color: var(--success); }
    .cloud-status-panel[data-status="syncing"], .cloud-status-panel[data-status="connecting"] { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 27%, var(--line)); }
    .cloud-status-panel[data-status="syncing"] .cloud-status-icon, .cloud-status-panel[data-status="connecting"] .cloud-status-icon { color: var(--primary); animation: syncpulse 1.15s ease-in-out infinite; }
    .cloud-status-panel[data-status="pending"] .cloud-status-icon { color: var(--warning); }
    .cloud-status-panel[data-status="offline"] .cloud-status-icon, .cloud-status-panel[data-status="unavailable"] .cloud-status-icon,
    .cloud-status-panel[data-status="error"] .cloud-status-icon, .cloud-status-panel[data-status="conflict"] .cloud-status-icon { color: var(--danger); }

    .cloud-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
    .account-row {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-top: 16px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--panel-solid);
    }
    .account-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
    .account-avatar {
      width: 42px;
      height: 42px;
      flex: 0 0 42px;
      display: grid;
      place-items: center;
      border-radius: 14px;
      color: white;
      font-weight: 800;
      background: linear-gradient(145deg, var(--primary), var(--primary-2));
    }
    .cloud-meta-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      margin-top: 12px;
    }
    .cloud-meta-grid > div { padding: 12px; border-radius: 14px; background: var(--panel-2); }
    .cloud-meta-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
    .cloud-meta-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cloud-message { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
    .cloud-message.error { color: var(--danger); }
    .cloud-message.success { color: var(--success); }
    .security-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
    .noscript { margin: 20px; padding: 16px; border-radius: 14px; background: #fff1f3; color: #a4162a; font-family: sans-serif; }

    @media (max-width: 820px) {
      .sync-pill { padding: 7px 9px; }
      .sync-pill #syncStatusText { display: none; }
    }

    @media (max-width: 540px) {
      .cloud-actions .btn { flex: 1 1 100%; }
      .cloud-meta-grid { grid-template-columns: 1fr; }
    }
