/* layout.css - theme toggle, card headers, hero, tabs */

  /* ---------- Theme toggle ---------- */

  .theme-toggle {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 50;
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s var(--spring);
    touch-action: manipulation;
  }
  .theme-toggle::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
  .theme-toggle:hover { background: var(--btn-hover); color: var(--text); }
  .theme-toggle:active { transform: scale(0.92); }
  .theme-toggle svg { animation: icon-pop 0.35s var(--spring); }
  @keyframes icon-pop {
    from { transform: scale(0.6) rotate(-40deg); opacity: 0; }
    to   { transform: scale(1) rotate(0); opacity: 1; }
  }

  /* theme switch: the new theme reveals in a circle growing out of the
     toggle button (View Transitions); JS drives the clip-path animation */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }

  /* fallback cross-fade for browsers without View Transitions */
  html.theme-fading,
  html.theme-fading *,
  html.theme-fading *::before,
  html.theme-fading *::after {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease,
                fill 0.5s ease, stroke 0.5s ease, box-shadow 0.5s ease !important;
  }

  .app {
    width: 100%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .view.hidden { display: none; }

  .view-planner {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* wide screens: День and Проекты side by side, Apple-grid style */
  @media (min-width: 920px) {
    .app { max-width: 1112px; }
    .view-planner {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      align-items: start;
    }
    .hero { padding: 0 6px 6px; }
  }

  .card {
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 28px 0 10px;
    overflow: hidden;
  }

  /* ---------- Day header ---------- */

  .header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px 14px;
  }

  .title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
  }

  .day-title {
    font-size: clamp(26px, 5vw, 31px);
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.15;
  }

  .ring { flex-shrink: 0; opacity: 1; transition: opacity 0.3s var(--ease-out); }
  .ring.hidden { opacity: 0; }
  .ring-track { stroke: var(--separator); }
  .ring-fill {
    stroke: var(--gc, var(--accent));
    transition: stroke-dashoffset 0.45s var(--ease-out), stroke 0.3s;
  }
  .ring.done .ring-fill { stroke: var(--success); }

  .subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 3px;
    letter-spacing: -0.01em;
  }

  /* ---------- Projects header ---------- */

  .proj-head {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 28px 8px;
  }

  .proj-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.018em;
  }

  /* ---------- Hero (greeting / clock / day progress) ---------- */

  .hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px 28px;
    padding: 0 8px;
    animation: hero-in 0.55s var(--ease-out) both;
  }
  @keyframes hero-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }

  .greeting {
    font-size: clamp(27px, 4.6vw, 38px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.12;
  }

  .hero-date {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 5px;
    letter-spacing: -0.01em;
  }

  .hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    margin-left: auto;
  }

  .clock {
    font-size: clamp(32px, 4.4vw, 42px);
    font-weight: 300;
    letter-spacing: 0.01em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

  .dp { display: flex; align-items: center; gap: 10px; }

  .dp-bar {
    width: 170px;
    height: 6px;
    border-radius: 980px;
    background: var(--chip-bg);
    position: relative;
  }

  .dp-fill {
    height: 100%;
    width: 0;
    border-radius: 980px;
    background: linear-gradient(90deg, var(--g-blue), var(--g-teal));
    position: relative;
  }
  .dp-fill::after {
    content: "";
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--g-teal);
    box-shadow: 0 0 10px 1px color-mix(in srgb, var(--g-teal) 70%, transparent);
  }

  .dp-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  /* ---------- Tabs (iOS segmented control) ---------- */

  .tabs-wrap { display: flex; justify-content: center; }

  .tabs {
    position: relative;
    display: flex;
    background: var(--chip-bg);
    border-radius: 11px;
    padding: 2px;
  }

  .tab-thumb {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 2px;
    width: calc(50% - 2px);
    background: var(--card);
    border-radius: 9px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
    transition: transform 0.28s var(--spring);
  }

  .tab-btn {
    position: relative;
    z-index: 1;
    appearance: none;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-secondary);
    width: 128px;
    padding: 7px 0;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color 0.2s;
    touch-action: manipulation;
  }
  .tab-btn[aria-selected="true"] { color: var(--text); }

  .tab-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
  }
  .tab-time:empty { display: none; }

  /* account mode adds the third «Списки» segment */
  .tab-btn.hidden { display: none; }
  .tabs.three .tab-thumb { width: calc(33.333% - 1.33px); }
  .tabs.three .tab-btn { width: 118px; }
  @media (max-width: 480px) {
    .tabs.three .tab-btn { width: 104px; }
  }

