/* Daily flow: minimal, mobile first. Everything is scoped under .tf-daily.
   Colours and fonts come from the shared theme (AppTheme / ExperienceThemes "default"),
   which MudThemeProvider in DailyLayout exposes as --mud-* variables. The fallbacks are
   the house theme, used until the provider has rendered. The same tokens style the app shell
   (.tf-app, see shell.css) so every client page shares them. */
.tf-daily, .tf-app {
    --d-bg: var(--mud-palette-background, #101A17);
    --d-surface: var(--mud-palette-surface, #172622);
    --d-line: var(--mud-palette-lines-default, #2C453D);
    --d-text: var(--mud-palette-text-primary, #F3EEE3);
    --d-muted: var(--mud-palette-text-secondary, #B4C0B8);
    --d-accent: var(--mud-palette-primary, #E8A34A);
    --d-on-accent: var(--mud-palette-primary-text, #101A17);
    --d-done: var(--mud-palette-success, #7FC8A0);
    --d-on-done: var(--mud-palette-success-text, #101A17);
    --d-selected: color-mix(in srgb, var(--d-accent) 12%, var(--d-bg));
    --d-font: var(--mud-typography-default-family, 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif);
    --d-heading-font: var(--mud-typography-h1-family, 'Source Serif 4', Georgia, serif);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--d-bg);
    color: var(--d-text);
    font-family: var(--d-font);
    display: flex;
    justify-content: center;
}

.tf-daily * { box-sizing: border-box; }

.tf-daily-shell {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 20px 20px 0 20px;
}

.tf-daily-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

.tf-daily h1, .tf-daily h2 {
    font-family: var(--d-heading-font);
    font-weight: 600;
    margin: 0;
    color: var(--d-text);
}
.tf-daily h1 { font-size: 32px; line-height: 1.15; }
.tf-daily h2 { font-size: 24px; line-height: 1.2; }
.tf-daily p { margin: 0; }

.tf-daily button { font-family: inherit; cursor: pointer; }
.tf-daily button:focus-visible,
.tf-daily a:focus-visible { outline: 3px solid var(--d-accent); outline-offset: 2px; }

.tf-d-eyebrow { font-size: 12px; letter-spacing: 0.12em; font-weight: 600; color: var(--d-muted); }
.tf-d-eyebrow.accent { color: var(--d-accent); }
.tf-daily h2.tf-d-eyebrow { font-family: var(--d-font); font-size: 12px; line-height: 1.4; color: var(--d-muted); }
.tf-d-muted { color: var(--d-muted); font-size: 15px; line-height: 1.5; }

.tf-d-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }

.tf-d-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--d-surface); border: 1px solid var(--d-line);
    border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 500;
}

.tf-d-back {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
    background: none; border: none; color: var(--d-muted); font-size: 15px; font-weight: 500; padding: 0;
}

.tf-d-week { display: flex; justify-content: space-between; margin: 20px 0 28px 0; padding: 0; list-style: none; }
.tf-d-day {
    width: 44px; height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: var(--d-muted); border: 1px solid var(--d-line);
}
.tf-d-day.done { background: var(--d-done); border-color: var(--d-done); color: var(--d-on-done); }
.tf-d-day.today { border: 3px solid var(--d-accent); color: var(--d-text); font-weight: 600; }
.tf-d-day.next { border: 2px solid var(--d-accent); color: var(--d-text); font-weight: 600; }
.tf-d-day.missed { border-style: dashed; }

.tf-d-card {
    background: var(--d-surface); border: 1px solid var(--d-line); border-radius: 24px;
    padding: 24px; display: flex; flex-direction: column; gap: 10px;
}
.tf-d-card.outline { background: transparent; border-radius: 20px; padding: 14px 20px; gap: 6px; }

.tf-d-primary {
    min-height: 56px; border-radius: 16px; border: none; background: var(--d-accent); color: var(--d-on-accent);
    font-weight: 600; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
}
.tf-d-primary[disabled] { opacity: 0.45; cursor: default; }
.tf-d-secondary {
    min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--d-line);
    background: transparent; color: var(--d-text); font-size: 14px;
}

.tf-d-list { list-style: none; margin: 0; padding: 0; }
.tf-d-list li {
    min-height: 52px; display: flex; align-items: center; gap: 12px; font-size: 15px;
    border-bottom: 1px solid var(--d-line);
}
.tf-d-list li:last-child { border-bottom: none; }
.tf-d-list svg { flex-shrink: 0; }

/* Week tab */
.tf-d-weeklist { list-style: none; margin: 8px 0 0 0; padding: 0; }
.tf-d-weeklist li {
    min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 10px 0;
    border-bottom: 1px solid var(--d-line);
}
.tf-d-weeklist li:last-child { border-bottom: none; }
.tf-d-weeklist .tf-d-day { flex-shrink: 0; }
.tf-d-weeklist .tf-d-weektext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tf-d-weeklist .tf-d-weektitle { font-size: 16px; color: var(--d-text); overflow-wrap: anywhere; }
.tf-d-weeklist .tf-d-weekstate { font-size: 13px; color: var(--d-muted); }

/* Player */
.tf-d-ring { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.tf-d-ring svg { position: absolute; inset: 0; }
.tf-d-play {
    position: absolute; left: 54px; top: 54px; width: 72px; height: 72px; border-radius: 999px; border: none;
    background: var(--d-accent); color: var(--d-on-accent); display: flex; align-items: center; justify-content: center;
}
.tf-d-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 14px; color: var(--d-muted); }
.tf-d-caption {
    margin-top: 16px; background: var(--d-surface); border: 1px solid var(--d-line); border-radius: 20px;
    padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-height: 132px;
}
.tf-d-caption p { font-size: 15px; line-height: 1.4; color: var(--d-muted); }
.tf-d-caption p.now {
    font-family: var(--d-heading-font); font-weight: 600; font-size: 21px; line-height: 1.3; color: var(--d-text);
}
.tf-d-script { max-height: 38vh; overflow-y: auto; }
.tf-d-script p { font-size: 15px; line-height: 1.5; color: var(--d-muted); }

/* Reflect */
.tf-d-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tf-d-chip {
    min-height: 56px; border-radius: 16px; border: 1px solid var(--d-line); background: transparent;
    color: var(--d-text); font-size: 16px;
}
.tf-d-chip[aria-pressed="true"] { border: 2px solid var(--d-accent); background: var(--d-selected); font-weight: 600; }
.tf-d-scale { display: flex; justify-content: space-between; }
.tf-d-scale button {
    width: 52px; height: 52px; border-radius: 999px; border: 1px solid var(--d-line); background: transparent;
    color: var(--d-text); font-size: 17px;
}
.tf-d-scale button[aria-pressed="true"] { border: 2px solid var(--d-accent); background: var(--d-selected); font-weight: 600; }
.tf-d-scale-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--d-muted); }

/* Done */
.tf-d-check {
    width: 96px; height: 96px; border-radius: 999px; background: var(--d-done);
    display: flex; align-items: center; justify-content: center;
}
.tf-d-center { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 44px; }

/* Bottom nav */
.tf-d-nav {
    margin-top: auto; display: flex; border-top: 1px solid var(--d-line); padding: 8px 0 max(20px, env(safe-area-inset-bottom)) 0;
    position: sticky; bottom: 0; z-index: 10; background: var(--d-bg);
}
.tf-d-nav a, .tf-d-nav button {
    flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; font-size: 12px; color: var(--d-muted); text-decoration: none;
    background: none; border: none; padding: 0; font-family: inherit;
}
.tf-d-nav a.active, .tf-d-nav button.active { color: var(--d-accent); font-weight: 600; }

.tf-d-spinner {
    width: 36px; height: 36px; border-radius: 999px; border: 4px solid var(--d-line); border-top-color: var(--d-accent);
    animation: tf-d-spin 0.9s linear infinite; margin: 64px auto;
}
@keyframes tf-d-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .tf-d-spinner { animation: none; }
}
