/* Claude-inspired theme tokens from 21st.dev/@serafim/themes/claude */
:root,
html[data-theme="light"] {
    color-scheme: light;
    --color-background: #faf9f5;
    --color-foreground: #3d3929;
    --color-strong: #141413;
    --color-card: #faf9f5;
    --color-surface: #ffffff;
    --color-popover: #ffffff;
    --color-primary: #c96442;
    --color-primary-hover: #b85839;
    --color-primary-soft: #f2ded5;
    --color-primary-foreground: #ffffff;
    --color-secondary: #e9e6dc;
    --color-secondary-foreground: #5d594d;
    --color-muted: #ede9de;
    --color-muted-foreground: #827e72;
    --color-accent: #e9e6dc;
    --color-border: #dad9d4;
    --color-border-strong: #b4b2a7;
    --color-warning: #9a4d34;
    --color-warning-bg: #f5e5dc;
    --color-warning-border: #e8c7b8;
    --color-success: #53735a;
    --color-success-bg: #e5ede4;
    --color-overlay: rgba(20, 20, 19, 0.46);
    --shadow-card: 0 24px 70px -44px rgba(56, 47, 33, 0.52), 0 2px 8px rgba(56, 47, 33, 0.05);
    --shadow-button: 0 1px 1px rgba(71, 41, 28, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    --focus-ring: rgba(201, 100, 66, 0.32);
    --background-glow: rgba(201, 100, 66, 0.10);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --color-background: #262624;
    --color-foreground: #c3c0b6;
    --color-strong: #faf9f5;
    --color-card: #262624;
    --color-surface: #30302e;
    --color-popover: #30302e;
    --color-primary: #d97757;
    --color-primary-hover: #e28262;
    --color-primary-soft: #4a3028;
    --color-primary-foreground: #ffffff;
    --color-secondary: #3a3935;
    --color-secondary-foreground: #f1eee5;
    --color-muted: #1b1b19;
    --color-muted-foreground: #aaa79d;
    --color-accent: #1a1915;
    --color-border: #3e3e38;
    --color-border-strong: #52514a;
    --color-warning: #ef9a79;
    --color-warning-bg: #3b2923;
    --color-warning-border: #664033;
    --color-success: #9cbea2;
    --color-success-bg: #29362b;
    --color-overlay: rgba(0, 0, 0, 0.72);
    --shadow-card: 0 24px 70px -42px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-button: 0 1px 1px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    --focus-ring: rgba(217, 119, 87, 0.34);
    --background-glow: rgba(217, 119, 87, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0 !important;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 78% 8%, var(--background-glow), transparent 24rem),
        var(--color-background) !important;
    color: var(--color-foreground) !important;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 180ms ease, color 180ms ease;
}

button,
select,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
    outline: 3px solid var(--focus-ring) !important;
    outline-offset: 3px;
}

svg {
    display: block;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: 9px 13px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-strong);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.page-shell {
    width: min(calc(100% - 48px), 1180px);
    min-height: 100vh;
    margin: 0 auto;
    border-right: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
    border-left: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 78px;
    padding: 16px 28px;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--color-strong);
    text-decoration: none;
}

.brand-mark {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(2, 1fr);
    width: 38px;
    height: 38px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
    border-radius: 10px;
    background: var(--color-surface);
    box-shadow: 0 1px 2px rgba(20, 20, 19, 0.08);
}

.brand-mark__tile {
    display: block;
}

.brand-mark__tile--cream {
    background: #faf9f5;
}

.brand-mark__tile--orange {
    background: var(--color-primary);
}

.brand-mark__tile--sand {
    grid-column: 1 / -1;
    background: var(--color-secondary);
}

.brand-mark__spark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--color-strong);
}

.brand-mark__spark svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-copy strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-copy small {
    margin-top: 3px;
    color: var(--color-muted-foreground);
    font-size: 11px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    margin-left: auto;
}

.header-link,
.header-button,
.theme-toggle {
    min-height: 36px;
    border-radius: 8px;
    color: var(--color-muted-foreground);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.header-link {
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
}

.header-link:hover {
    color: var(--color-strong);
}

.header-button,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface) 74%, transparent);
}

.header-button:hover,
.theme-toggle:hover {
    border-color: var(--color-border-strong);
    background: var(--color-secondary);
    color: var(--color-strong);
}

.header-button:active,
.theme-toggle:active {
    transform: scale(0.97);
}

.header-button svg,
.theme-toggle svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-icon--sun {
    display: none;
}

html[data-theme="dark"] .theme-icon--moon {
    display: none;
}

html[data-theme="dark"] .theme-icon--sun {
    display: block;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 78px);
    min-height: calc(100svh - 78px);
    padding: clamp(40px, 7vw, 82px) 32px;
}

.hero-copy,
.session-card {
    animation: rise-in 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.session-card {
    animation-delay: 90ms;
}

.eyebrow,
.section-label {
    color: var(--color-muted-foreground);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.105em;
    line-height: 1.3;
    text-transform: uppercase;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.hero h1 {
    max-width: 650px;
    margin: 0;
    color: var(--color-strong);
    font-size: clamp(48px, 5vw, 68px);
    font-weight: 620;
    letter-spacing: -0.058em;
    line-height: 1.01;
}

.hero h1 span {
    color: var(--color-primary);
}

.hero-lead {
    max-width: 570px;
    margin: 28px 0 0;
    color: var(--color-muted-foreground);
    font-size: 17px;
    line-height: 1.72;
}

.hero-details {
    display: flex;
    flex-wrap: wrap;
    gap: 13px 22px;
    margin-top: 34px;
}

.hero-detail {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--color-foreground);
    font-size: 12px;
    font-weight: 600;
}

.hero-detail svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.session-card {
    position: relative;
    width: min(100%, 520px);
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.session-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-primary) 38%, transparent), transparent);
    content: "";
}

.session-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--color-border);
}

.session-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--color-success) 30%, var(--color-border));
    border-radius: 999px;
    background: var(--color-success-bg);
    color: var(--color-success);
    font-size: 11px;
    font-weight: 700;
}

.session-state__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

body.is-running .session-state {
    border-color: color-mix(in srgb, var(--color-primary) 36%, var(--color-border));
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

body.is-running .session-state__dot {
    animation: status-pulse 1.6s ease-out infinite;
}

.session-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 0 18px;
}

.session-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 45px;
    height: 45px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 26%, var(--color-border));
    border-radius: 10px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.session-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.session-heading h2 {
    margin: 0;
    color: var(--color-strong);
    font-size: 20px;
    font-weight: 690;
    letter-spacing: -0.025em;
}

.session-heading p {
    margin: 4px 0 0;
    color: var(--color-muted-foreground);
    font-size: 12px;
}

.settings-summary {
    min-height: 65px;
    padding: 14px 15px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--color-muted) 62%, transparent);
    color: var(--color-muted-foreground);
    font-size: 12px;
    line-height: 1.55;
}

.settings-summary strong {
    color: var(--color-foreground);
    font-weight: 700;
}

.summary-skeleton {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-border-strong) 28%, transparent);
    animation: skeleton-pulse 1.2s ease-in-out infinite alternate;
}

.summary-skeleton--long {
    width: 88%;
    margin-top: 4px;
}

.summary-skeleton--short {
    width: 58%;
    margin-top: 10px;
}

.session-progress {
    padding: 17px 1px 5px;
}

.progress-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
    color: var(--color-muted-foreground);
    font-size: 11px;
    font-weight: 650;
}

.progress-copy strong {
    color: var(--color-foreground);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-secondary);
}

.progress-track span {
    position: relative;
    display: block;
    width: 0;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    background: var(--color-primary);
    transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-running .progress-track span::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    content: "";
    transform: translateX(-100%);
    animation: progress-shine 1.8s linear infinite;
}

.timer-panel {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-height: 40px;
    margin: 13px 0 15px;
    padding: 10px 11px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--color-secondary) 55%, transparent);
    color: var(--color-muted-foreground);
    font-size: 11px;
    line-height: 1.5;
}

.timer-panel svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.timer-panel strong {
    color: var(--color-foreground);
    font-weight: 700;
}

.session-actions {
    display: flex;
    gap: 8px;
}

.primary-action,
.stop-action {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    min-height: 58px;
    padding: 8px 13px 8px 9px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--color-primary) 75%, #5c2c1e);
    border-radius: 9px;
    background: var(--color-primary);
    box-shadow: var(--shadow-button);
    color: var(--color-primary-foreground);
    text-align: left;
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-action:hover,
.stop-action:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 7px 18px color-mix(in srgb, var(--color-primary) 23%, transparent), var(--shadow-button);
}

.primary-action:active,
.stop-action:active,
.settings-action:active {
    transform: scale(0.985);
}

.primary-action__icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 39px;
    height: 39px;
    margin-right: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
}

.primary-action__icon svg,
.primary-action__arrow {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.primary-action__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.primary-action__copy strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 720;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.primary-action__copy small {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    font-weight: 500;
}

.primary-action__arrow {
    flex: 0 0 auto;
    margin-left: auto;
    transition: transform 160ms ease;
}

.primary-action:hover .primary-action__arrow,
.stop-action:hover .primary-action__arrow {
    transform: translateX(2px);
}

#btn-stop {
    display: none;
    border-color: color-mix(in srgb, var(--color-strong) 20%, var(--color-border));
    background: var(--color-strong);
    color: var(--color-background);
}

#btn-stop:hover {
    background: color-mix(in srgb, var(--color-strong) 88%, var(--color-primary));
}

html[data-theme="dark"] #btn-stop .primary-action__icon {
    border-color: rgba(0, 0, 0, 0.14);
    background: rgba(0, 0, 0, 0.09);
}

html[data-theme="dark"] #btn-stop .primary-action__copy small {
    color: rgba(38, 38, 36, 0.7);
}

.settings-action {
    display: grid;
    flex: 0 0 58px;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-card);
    color: var(--color-muted-foreground);
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.settings-action:hover {
    border-color: var(--color-border-strong);
    background: var(--color-secondary);
    color: var(--color-strong);
}

.settings-action svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.keep-open-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 13px 0 0;
    color: var(--color-muted-foreground);
    font-size: 10px;
}

.keep-open-note svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.workflow-section {
    padding: 92px 52px 96px;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
}

.section-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 30px;
}

.section-heading-row h2 {
    margin: 10px 0 0;
    color: var(--color-strong);
    font-size: clamp(30px, 3.2vw, 42px);
    font-weight: 630;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--color-muted-foreground);
    font-size: 12px;
    font-weight: 650;
    transition: color 160ms ease;
}

.text-button:hover {
    color: var(--color-primary);
}

.text-button svg,
.secondary-link svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
}

.text-button:hover svg {
    transform: translateX(2px);
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
}

.workflow-card {
    display: flex;
    min-height: 295px;
    flex-direction: column;
    padding: 25px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-card) 74%, transparent);
    transition: background-color 180ms ease;
}

.workflow-card:hover {
    background: color-mix(in srgb, var(--color-secondary) 43%, var(--color-card));
}

.workflow-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 39px;
}

.step-number {
    color: var(--color-muted-foreground);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10px;
    font-weight: 650;
}

.step-icon {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-primary);
}

.step-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.workflow-card h3 {
    margin: 0;
    color: var(--color-strong);
    font-size: 17px;
    font-weight: 680;
    letter-spacing: -0.025em;
}

.workflow-card p {
    margin: 10px 0 25px;
    color: var(--color-muted-foreground);
    font-size: 13px;
    line-height: 1.65;
}

.workflow-card a,
.workflow-card > button {
    align-self: flex-start;
    margin-top: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-foreground);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: color 160ms ease;
}

.workflow-card a:hover,
.workflow-card > button:hover {
    color: var(--color-primary);
}

.responsible-use {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    margin: 52px;
    padding: 27px;
    border: 1px solid var(--color-warning-border);
    border-radius: 10px;
    background: var(--color-warning-bg);
}

.responsible-use__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid color-mix(in srgb, var(--color-warning) 22%, transparent);
    border-radius: 9px;
    background: color-mix(in srgb, var(--color-surface) 52%, transparent);
    color: var(--color-warning);
}

.responsible-use__icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.responsible-use__copy h2 {
    margin: 6px 0 5px;
    color: var(--color-strong);
    font-size: 18px;
    font-weight: 680;
    letter-spacing: -0.025em;
}

.responsible-use__copy p {
    max-width: 690px;
    margin: 0;
    color: var(--color-muted-foreground);
    font-size: 12px;
    line-height: 1.6;
}

.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 39px;
    padding: 0 13px;
    border: 1px solid color-mix(in srgb, var(--color-warning) 20%, var(--color-border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--color-surface) 72%, transparent);
    color: var(--color-foreground);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.secondary-link:hover {
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.secondary-link:hover svg {
    transform: translate(1px, -1px);
}

.site-footer {
    padding: 35px 28px 27px;
    border-top: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
}

.footer-main,
.footer-meta {
    display: flex;
    justify-content: space-between;
    gap: 28px;
}

.footer-main {
    align-items: center;
    padding-bottom: 25px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.footer-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, transparent 49%, var(--color-primary) 50%),
        var(--color-secondary);
    box-shadow: inset 0 0 0 1px var(--color-border);
}

.footer-brand strong {
    color: var(--color-strong);
    font-size: 13px;
    font-weight: 700;
}

.footer-brand p {
    margin: 1px 0 0;
    color: var(--color-muted-foreground);
    font-size: 10px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 21px;
}

.footer-links a,
.footer-links button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-muted-foreground);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: color 160ms ease;
}

.footer-links a:hover,
.footer-links button:hover,
.footer-meta a:hover {
    color: var(--color-primary);
}

.footer-meta {
    align-items: flex-end;
    padding-top: 23px;
    border-top: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
}

.footer-meta p,
.footer-meta small {
    display: block;
    margin: 0;
    color: var(--color-muted-foreground);
    font-size: 10px;
    line-height: 1.6;
}

.footer-meta a {
    color: var(--color-foreground);
    font-weight: 650;
    text-decoration: none;
}

#div-bing {
    position: fixed !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
}

/* Modal */
.modal-backdrop.show {
    opacity: 1;
    background: var(--color-overlay);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.modal-dialog {
    width: min(calc(100% - 28px), 740px);
    max-width: 740px;
    margin-right: auto;
    margin-left: auto;
}

.modal-content {
    max-height: min(850px, calc(100vh - 32px));
    overflow: hidden;
    border: 1px solid var(--color-border) !important;
    border-radius: 12px !important;
    background: var(--color-popover) !important;
    box-shadow: 0 30px 90px -25px rgba(0, 0, 0, 0.52) !important;
    color: var(--color-foreground) !important;
}

.modal-header {
    align-items: center !important;
    padding: 19px 21px !important;
    border-bottom: 1px solid var(--color-border) !important;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title-icon {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 24%, var(--color-border));
    border-radius: 9px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.modal-title-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal-title {
    margin: 3px 0 0 !important;
    color: var(--color-strong) !important;
    font-size: 18px !important;
    font-weight: 680 !important;
    letter-spacing: -0.025em;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    margin-left: auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-card);
    color: var(--color-muted-foreground);
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.modal-close:hover {
    background: var(--color-secondary);
    color: var(--color-strong);
}

.modal-close:active {
    transform: scale(0.96);
}

.modal-close svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.modal-body {
    padding: 21px !important;
    background: var(--color-popover);
}

.modal-section-heading {
    margin-bottom: 14px;
}

.modal-section-heading h3 {
    margin: 5px 0 0;
    color: var(--color-strong);
    font-size: 15px;
    font-weight: 680;
    letter-spacing: -0.02em;
}

.settings-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.autosave-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-muted-foreground);
    font-size: 10px;
    font-weight: 650;
}

.autosave-badge span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.field-group {
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--color-card) 65%, transparent);
}

.field-group--wide {
    grid-column: 1 / -1;
}

.field-group label {
    display: block;
    margin: 0;
    color: var(--color-strong);
    font-size: 11px;
    font-weight: 700;
}

.field-group p {
    min-height: 16px;
    margin: 3px 0 10px;
    color: var(--color-muted-foreground);
    font-size: 9px;
}

.form-select {
    min-height: 39px;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    border: 1px solid var(--color-border-strong) !important;
    border-radius: 7px !important;
    background-color: var(--color-surface) !important;
    color: var(--color-foreground) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.form-select:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px var(--focus-ring) !important;
}

html[data-theme="dark"] .form-select {
    background-image: var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none) !important;
}

.modal-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 21px !important;
    border-top: 1px solid var(--color-border) !important;
    background: color-mix(in srgb, var(--color-muted) 36%, var(--color-popover));
}

.modal-footer p {
    margin: 0;
    color: var(--color-muted-foreground);
    font-size: 10px;
}

.modal-done {
    min-width: 78px;
    min-height: 35px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 75%, #5c2c1e);
    border-radius: 7px;
    background: var(--color-primary);
    box-shadow: var(--shadow-button);
    color: var(--color-primary-foreground);
    font-size: 11px;
    font-weight: 700;
    transition: background-color 160ms ease, transform 160ms ease;
}

.modal-done:hover {
    background: var(--color-primary-hover);
}

.modal-done:active {
    transform: scale(0.97);
}

/* Carbon Ads */
.carbonads-container {
    display: flex;
    flex: 0 1 330px;
    min-width: 0;
    max-width: 330px;
    justify-content: flex-start;
}

.carbonads-container #carbonads,
.carbonads-container #carbon-responsive {
    width: 100%;
    min-width: 0;
}

#carbonads,
#carbon-responsive .carbon-responsive-wrap {
    display: block;
    max-width: 100%;
    padding: 8px !important;
    overflow: hidden;
    border: 1px solid var(--color-border) !important;
    border-radius: 8px !important;
    background: var(--color-card) !important;
    color: var(--color-muted-foreground) !important;
    font-family: inherit !important;
}

.carbon-wrap,
#carbon-responsive .carbon-responsive-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.carbon-img,
.carbon-img-large {
    width: auto !important;
    flex: 0 0 auto !important;
}

.carbon-img img,
.carbon-img-large img {
    display: block;
    width: 38px !important;
    height: 38px !important;
    border-radius: 5px;
    object-fit: cover;
}

.carbon-text,
.carbon-description {
    padding: 0 !important;
    color: var(--color-muted-foreground) !important;
    font-size: 9px !important;
    line-height: 1.4 !important;
    text-align: left;
    text-decoration: none !important;
}

.carbon-poweredby {
    display: none !important;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes status-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 55%, transparent); }
    70% { box-shadow: 0 0 0 6px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes skeleton-pulse {
    from { opacity: 0.38; }
    to { opacity: 0.75; }
}

@keyframes progress-shine {
    to { transform: translateX(100%); }
}

@media (max-width: 1020px) {
    .responsible-use {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .responsible-use .secondary-link {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: calc(100% - 24px);
    }

    .site-header {
        min-height: 70px;
        padding: 13px 17px;
    }

    .header-link {
        display: none;
    }

    .hero {
        min-height: calc(100vh - 70px);
        min-height: calc(100svh - 70px);
        padding: 48px 30px;
    }

    .hero h1 {
        font-size: clamp(43px, 12vw, 58px);
    }

    .hero-lead {
        font-size: 15px;
    }

    .workflow-section {
        padding: 70px 30px 74px;
    }

    .section-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .workflow-card {
        min-height: 250px;
    }

    .responsible-use {
        margin: 38px 30px;
    }

    .footer-main,
    .footer-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-links {
        flex-wrap: wrap;
    }

    .carbonads-container {
        justify-content: flex-start;
    }

}

@media (max-width: 540px) {
    .page-shell {
        width: 100%;
        border: 0;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .brand-copy small {
        display: none;
    }

    .header-actions {
        gap: 5px;
    }

    .header-button,
    .theme-toggle {
        width: 35px;
        min-height: 35px;
        padding: 0;
    }

    .header-button span,
    .theme-toggle span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .hero {
        padding: 36px 17px;
    }

    .eyebrow {
        margin-bottom: 19px;
        font-size: 9px;
    }

    .hero h1 {
        font-size: clamp(39px, 12.5vw, 49px);
        letter-spacing: -0.055em;
    }

    .hero-lead {
        margin-top: 22px;
        font-size: 14px;
        line-height: 1.65;
    }

    .hero-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-top: 26px;
    }

    .hero-detail:last-child {
        grid-column: 1 / -1;
    }

    .session-card {
        padding: 17px;
        border-radius: 10px;
    }

    .session-heading {
        align-items: flex-start;
    }

    .session-heading h2 {
        font-size: 18px;
    }

    .session-actions {
        gap: 7px;
    }

    .primary-action,
    .stop-action {
        padding-right: 11px;
    }

    .primary-action__arrow {
        display: none;
    }

    .settings-action {
        flex-basis: 58px;
    }

    .workflow-section {
        padding: 59px 17px 62px;
    }

    .section-heading-row h2 {
        font-size: 32px;
    }

    .workflow-card {
        min-height: 235px;
        padding: 22px;
    }

    .responsible-use {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 27px 17px;
        padding: 21px;
    }

    .responsible-use .secondary-link {
        grid-column: 1;
    }

    .site-footer {
        padding: 28px 17px 23px;
    }

    .footer-links {
        gap: 14px;
    }

    .modal-dialog {
        width: calc(100% - 16px);
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .modal-content {
        max-height: calc(100vh - 16px);
        border-radius: 10px !important;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    .modal-title-icon {
        display: none;
    }

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

    .field-group--wide {
        grid-column: auto;
    }

    .modal-footer p {
        max-width: 190px;
    }
}

@media (max-width: 370px) {
    .primary-action__icon {
        display: none;
    }

    .primary-action__copy {
        padding-left: 4px;
    }

    .settings-action {
        flex-basis: 50px;
        width: 50px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
