:root {
    --vp-c-brand: rgb(168, 177, 255);
    --vp-c-brand-light: rgb(188, 195, 255);
    --vp-c-brand-lighter: rgb(208, 213, 255);
    --vp-c-brand-dark: rgb(148, 158, 255);
    --vp-c-brand-darker: rgb(128, 139, 255);
    --brand-accent: rgb(72, 82, 205);
    --brand-accent-hover: rgb(58, 69, 185);
    --background: 0 0% 100%;
    --foreground: 240 4% 14%;
    --card: 0 0% 100%;
    --card-foreground: 240 4% 14%;
    --primary: 235 58% 54%;
    --primary-foreground: 0 0% 100%;
    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 4% 14%;
    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3% 36%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 5.9% 90%;
    --input: 240 5.9% 90%;
    --ring: 235 58% 54%;
    --footer-background: 0 0% 100%;
    --footer-foreground: 240 4% 14%;
    --radius: 0.5rem;
    --control-height: 2.5rem;
}

[data-theme="dark"] {
    --brand-accent: rgb(168, 177, 255);
    --brand-accent-hover: rgb(188, 195, 255);
    --background: 240 7% 11%;
    --foreground: 240 8% 82%;
    --card: 240 7% 11%;
    --card-foreground: 240 8% 82%;
    --primary: 234 100% 83%;
    --primary-foreground: 240 7% 11%;
    --secondary: 240 7% 16%;
    --secondary-foreground: 240 8% 82%;
    --muted: 240 7% 16%;
    --muted-foreground: 240 5% 66%;
    --destructive: 0 62.8% 50.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 5% 18%;
    --input: 240 7% 16%;
    --ring: 234 100% 83%;
    --footer-background: 240 4% 9%;
    --footer-foreground: 240 8% 82%;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: hsl(var(--background));
}

body {
    min-height: 100vh;
    min-width: 320px;
    margin: 0;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 14px;
    letter-spacing: 0;
}

a {
    color: inherit;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-shell-main {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    flex: 1;
    flex-direction: column;
}

.app-shell-authenticated {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.page-no-scroll {
    overflow: hidden;
}

.page-no-scroll .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.topbar {
    display: flex;
    height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--footer-background));
    padding: 0 2rem;
    position: relative;
}

.sidebar {
    display: none;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    border-right: 1px solid hsl(var(--border));
    background: hsl(var(--footer-background));
}

.sidebar-inner {
    display: flex;
    width: 100%;
    min-height: 100%;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0.625rem;
}

.sidebar-brand {
    display: flex;
    width: 100%;
    padding: 0.25rem 0.375rem 0.75rem;
    position: relative;
}

.sidebar-brand::after {
    content: "";
    position: absolute;
    left: -0.625rem;
    right: -0.625rem;
    bottom: 0;
    border-bottom: 1px solid hsl(var(--border));
}

.sidebar-nav {
    display: grid;
    gap: 0.45rem;
    align-content: start;
}

.sidebar-section-label {
    color: hsl(var(--muted-foreground));
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 0.75rem;
}

.sidebar-section-label-spaced {
    margin-top: 0.65rem;
}

.sidebar-link {
    display: inline-flex;
    min-height: var(--control-height);
    align-items: center;
    justify-content: flex-start;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, hsl(var(--background) / 0.94), hsl(var(--background) / 0.82));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    padding: 0 0.75rem;
    text-decoration: none;
    transition:
        border-color 120ms ease,
        background-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease;
}

.sidebar-link:hover {
    border-color: hsl(var(--ring) / 0.7);
    background:
        linear-gradient(180deg, hsl(var(--background) / 0.98), hsl(var(--background) / 0.88));
    color: hsl(var(--foreground));
    box-shadow: 0 0 0 1px hsl(var(--ring) / 0.22) inset;
}

.sidebar-link-active {
    border-color: hsl(var(--ring));
    background:
        linear-gradient(180deg, hsl(var(--background) / 1), hsl(var(--background) / 0.9));
    color: hsl(var(--foreground));
    box-shadow:
        0 0 0 1px hsl(var(--ring) / 0.25) inset,
        0 0 18px hsl(var(--ring) / 0.18);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: var(--radius);
    background: hsl(var(--footer-background));
    border: 1px solid hsl(var(--border));
    overflow: hidden;
}

.brand-logo {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
}

.brand strong {
    display: block;
    font-weight: 600;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand small {
    display: block;
    color: hsl(var(--muted-foreground));
    font-size: 0.78rem;
    line-height: 1.2;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-actions,
.button-row,
.form-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
    margin-left: auto;
}

.nav-link-secondary {
    flex: 0 0 auto;
}

.error-actions {
    justify-content: center;
}

.auth-actions {
    justify-content: center;
}

.nav-link {
    display: inline-flex;
    height: var(--control-height);
    align-items: center;
    justify-content: center;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    padding: 0 0.75rem;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    background: transparent;
    border-bottom-color: hsl(var(--ring));
    color: var(--brand-accent);
}

.nav-link-active {
    background: transparent;
    border-bottom-color: hsl(var(--ring));
    color: var(--brand-accent);
}

.mobile-nav-menu {
    display: none;
}

.mobile-nav-menu summary {
    list-style: none;
}

.mobile-nav-menu summary::-webkit-details-marker {
    display: none;
}

.topbar-dropdown {
    position: relative;
}

.topbar-dropdown-trigger {
    cursor: default;
}

.topbar-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    display: none;
    min-width: 13rem;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
    box-shadow: none;
}

.topbar-dropdown:hover .topbar-dropdown-menu,
.topbar-dropdown:focus-within .topbar-dropdown-menu {
    display: grid;
}

.topbar-dropdown-link {
    display: inline-flex;
    min-height: var(--control-height);
    align-items: center;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0 0.75rem;
    text-decoration: none;
}

.topbar-dropdown-link:hover {
    background: transparent;
    border-bottom-color: hsl(var(--ring));
    color: var(--brand-accent);
}

.topbar-dropdown-link-active {
    border-color: transparent;
    border-bottom-color: hsl(var(--ring));
    background: transparent;
    color: var(--brand-accent);
}

.main {
    width: min(1040px, calc(100% - 2rem));
    flex: 1;
    margin: 0 auto;
    padding: 2rem 0;
}

.page-no-scroll .main {
    display: grid;
    min-height: 0;
    padding: 0;
}

.workflow-page .main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.audio-transcription-page .main {
    padding: 2rem 0;
}

.auth-layout {
    display: grid;
    min-height: calc(100vh - 128px);
    place-items: center;
}

.page-no-scroll .auth-layout {
    min-height: 100%;
}

.error-layout {
    min-height: calc(100vh - 64px - 56px - 4rem);
    min-height: calc(100dvh - 64px - 56px - 4rem);
}

.panel {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04);
}

.auth-panel {
    width: min(384px, 100%);
    padding: 1.5rem;
}

.stack {
    display: grid;
    gap: 1rem;
}

.center {
    text-align: center;
}

.eyebrow {
    color: var(--brand-accent);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

h2 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.muted,
.help-text {
    color: hsl(var(--muted-foreground));
}

.profile-block {
    display: grid;
    justify-items: center;
    gap: 0.4rem;
}

.avatar {
    width: 4.5rem;
    height: 4.5rem;
    border: 0;
    border-radius: var(--radius);
    object-fit: cover;
    object-position: center;
    display: block;
}

.avatar-small {
    width: 2rem;
    height: 2rem;
}

.avatar-header {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    overflow: hidden;
}

.avatar-fallback {
    display: grid;
    place-items: center;
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    font-size: 0.875rem;
    font-weight: 600;
}

.profile-name {
    font-weight: 600;
}

.button {
    display: inline-flex;
    height: var(--control-height);
    align-items: center;
    justify-content: center;
    border: 1px solid hsl(var(--primary));
    border-radius: var(--radius);
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    padding: 0 1rem;
    text-decoration: none;
    transition:
        background-color 120ms ease,
        border-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease;
}

.button:hover {
    background: var(--brand-accent-hover);
}

.button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.button-full {
    width: 100%;
}

.button-outline {
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}

.button-outline:hover {
    background: hsl(var(--secondary));
}

.button-destructive {
    border-color: hsl(var(--destructive));
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.button-destructive:hover {
    background: hsl(var(--destructive) / 0.9);
}

.button-muted {
    border-color: hsl(var(--border));
    background: hsl(var(--secondary));
    color: hsl(var(--muted-foreground));
    cursor: default;
}

.button-muted:hover {
    background: hsl(var(--secondary));
}

.alert {
    margin-bottom: 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 0.75rem 0.875rem;
}

.alert-error {
    border-color: hsl(0 84.2% 85%);
    background: hsl(0 84.2% 97%);
    color: hsl(0 72.2% 35%);
}

.alert-success {
    border-color: hsl(142 76% 82%);
    background: hsl(138 76% 97%);
    color: hsl(142 72% 25%);
}

.alert-warning {
    border-color: hsl(43 92% 82%);
    background: hsl(48 100% 96%);
    color: hsl(33 83% 28%);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header>div:first-child {
    display: grid;
    max-width: 640px;
    gap: 0.45rem;
}

.page-header h1 {
    font-size: 1.5rem;
    line-height: 1.25;
}

.page-header .muted {
    font-size: 0.9375rem;
    line-height: 1.55;
}

.header-profile {
    display: inline-flex;
    height: var(--control-height);
    align-items: center;
    gap: 0.625rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    padding: 0.25rem 0.625rem 0.25rem 0.25rem;
    font-weight: 500;
}

.header-profile-button {
    width: var(--control-height);
    height: var(--control-height);
    justify-content: center;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    padding: 0;
    cursor: pointer;
}

.header-profile-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 40;
    min-width: 14rem;
    display: none;
    gap: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) + 2px);
    background: hsl(var(--background));
    box-shadow: 0 16px 40px hsl(var(--shadow) / 0.16);
    padding: 0.85rem;
}

.header-profile-menu:hover .header-profile-dropdown,
.header-profile-menu:focus-within .header-profile-dropdown {
    display: grid;
}

.header-profile-dropdown-user {
    display: grid;
    gap: 0.15rem;
    line-height: 1.2;
}

.header-profile-dropdown-user strong {
    font-size: 0.9375rem;
    word-break: break-word;
}

.header-profile-logout {
    width: 100%;
    justify-content: center;
}

.theme-toggle {
    width: var(--control-height);
    padding: 0;
}

.topbar-settings-button {
    width: var(--control-height);
    padding: 0;
}

.topbar-settings-button-active {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 1px hsl(var(--ring) / 0.2) inset;
}

.topbar-settings-icon {
    width: 1rem;
    height: 1rem;
    font-size: 1.1rem;
    line-height: 1;
    font-variation-settings: "FILL" 0;
}

.theme-icon {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

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

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

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

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

.action-card {
    display: grid;
    min-height: 156px;
    align-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.action-card>div {
    display: grid;
    gap: 0.45rem;
}

.action-card h2 {
    font-size: 0.975rem;
    line-height: 1.35;
}

.action-card .muted {
    font-size: 0.875rem;
    line-height: 1.5;
}

.desktop-download-panel {
    width: min(520px, 100%);
    padding: 1.5rem;
}

.desktop-download-stack {
    gap: 1.25rem;
}

.desktop-download-header {
    display: grid;
    gap: 0.5rem;
}

.desktop-platform-icon {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.desktop-download-copy {
    max-width: 34rem;
    font-size: 0.9375rem;
    line-height: 1.65;
}

.desktop-download-primary-shell {
    gap: 0.5rem;
}

.desktop-download-primary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.875rem;
    min-height: 4.25rem;
    align-items: center;
    padding: 0.75rem 1rem;
    text-align: left;
}

.desktop-download-primary-icon {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: hsl(var(--primary-foreground) / 0.14);
    color: hsl(var(--primary-foreground));
}

.desktop-download-primary-icon .desktop-platform-icon {
    width: 0.95rem;
    height: 0.95rem;
    stroke: currentColor;
}

.desktop-download-primary-text {
    display: grid;
    align-content: center;
    gap: 0.2rem;
    min-width: 0;
}

.desktop-download-primary-text strong,
.desktop-download-primary-text small {
    display: block;
}

.desktop-download-primary-text strong {
    color: hsl(var(--primary-foreground));
    font-size: 0.9375rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.desktop-download-primary-text small {
    color: hsl(var(--primary-foreground) / 0.82);
    font-size: 0.75rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.desktop-download-help {
    text-align: center;
}

.desktop-download-manual {
    display: grid;
    gap: 0.75rem;
    padding-top: 0.25rem;
}

.desktop-download-manual-label {
    text-align: center;
}

.desktop-download-option-grid {
    display: grid;
    gap: 0.75rem;
}

.desktop-download-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.875rem;
    align-items: center;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    color: inherit;
    min-height: var(--control-height);
    padding: 0.625rem 1rem;
    text-decoration: none;
    transition:
        border-color 120ms ease,
        background-color 120ms ease,
        box-shadow 120ms ease;
}

.desktop-download-option:hover {
    border-color: hsl(var(--ring));
    background: hsl(var(--secondary) / 0.55);
}

.desktop-download-option-icon {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
}

.desktop-download-option-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.desktop-download-option-copy strong,
.desktop-download-option-copy small {
    display: block;
}

.desktop-download-option-copy strong {
    font-size: 0.875rem;
    line-height: 1.25;
}

.desktop-download-option-copy small {
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.desktop-download-actions {
    justify-content: center;
    padding-top: 0.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.form-wide {
    grid-column: 1 / -1;
}

.field {
    display: grid;
    gap: 0.375rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font: inherit;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
}

input::placeholder,
textarea::placeholder {
    color: hsl(var(--muted-foreground));
}

input[type="file"] {
    padding: 0.45rem 0.75rem;
}

input[type="file"]::file-selector-button {
    height: 1.75rem;
    margin-right: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
    padding: 0 0.625rem;
}

input[type="checkbox"] {
    width: auto;
    min-height: 0;
}

textarea {
    resize: vertical;
}

.transcription-upload-panel textarea {
    min-height: 11.75rem;
    max-height: 220px;
    resize: none;
}

.help-text,
.field-error {
    font-size: 0.8125rem;
    line-height: 1.35;
}

.field-error {
    color: hsl(0 72.2% 35%);
}

.errorlist {
    margin: 0;
    padding-left: 1.25rem;
}

.form-actions {
    justify-content: flex-end;
    padding-top: 0.25rem;
}

.form-field {
    display: grid;
    gap: 0.375rem;
}

.checkbox-field {
    align-items: center;
    grid-template-columns: auto 1fr;
}

.checkbox-field .help-text {
    grid-column: 1 / -1;
}

fieldset.form-field {
    min-width: 0;
    border: 0;
    padding: 0;
}

fieldset.form-field legend {
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.choice-list {
    display: grid;
    gap: 0.625rem;
}

.choice-card {
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    width: 100%;
    gap: 0.75rem;
    align-items: start;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    cursor: pointer;
    padding: 0.85rem;
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

.choice-card:hover {
    border-color: hsl(var(--ring));
}

.choice-card-disabled {
    cursor: default;
    background: hsl(var(--secondary));
}

.choice-card-disabled:hover {
    border-color: hsl(var(--border));
}

.choice-card-disabled .choice-check {
    background: hsl(var(--secondary));
}

.choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-check {
    position: relative;
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
    border: 1px solid hsl(var(--border));
    border-radius: 4px;
    background: hsl(var(--background));
    margin-top: 0.1rem;
}

.choice-card input:checked+.choice-check {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary));
}

.choice-card input:checked+.choice-check::after {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 0.16rem;
    width: 0.28rem;
    height: 0.55rem;
    border: solid hsl(var(--primary-foreground));
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.choice-card input:focus-visible+.choice-check {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.choice-label,
.choice-description {
    display: block;
}

.choice-label {
    line-height: 1.25;
}

.choice-description {
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
    line-height: 1.35;
    margin-top: 0.2rem;
}

.choice-card-readonly {
    cursor: default;
    grid-template-columns: minmax(0, 1fr);
}

.choice-card-readonly:hover {
    border-color: hsl(var(--border));
}

.users-panel {
    padding: 1rem;
}

.add-user-panel {
    padding: 1rem;
}

.user-config-panel {
    display: grid;
    gap: 1.25rem;
    padding: 1rem;
}

.user-config-panel+.user-config-panel {
    margin-top: 1rem;
}

.users-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) repeat(2, minmax(160px, 0.8fr)) auto;
    gap: 0.75rem;
    align-items: end;
    margin-top: 1rem;
}

.users-filter-search {
    min-width: 0;
}

.users-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.users-filter-actions .button {
    min-width: 0;
    white-space: nowrap;
}

.users-filter-bar input,
.users-filter-bar select {
    padding: 0.45rem 0.875rem;
}

.users-filter-bar select {
    padding-right: 2.25rem;
}

.users-table-shell {
    margin-top: 1rem;
    overflow-x: auto;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.users-table th,
.users-table td {
    padding: 0.75rem 0.875rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid hsl(var(--border));
}

.users-table th {
    background: hsl(var(--secondary));
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.users-table tbody tr:last-child td {
    border-bottom: 0;
}

.users-table td {
    font-size: 0.875rem;
}

.users-table tbody tr:hover {
    background: hsl(var(--secondary) / 0.35);
}

.users-table-user {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}

.users-table td,
.users-table th {
    overflow-wrap: anywhere;
}

.users-table-action {
    width: 9.5rem;
    white-space: nowrap;
    text-align: right;
}

.users-table-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.users-table-tag {
    display: inline-flex;
    min-height: 1.85rem;
    align-items: center;
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    padding: 0.3rem 0.7rem;
}

.users-table-tag-empty {
    color: hsl(var(--muted-foreground));
}

.users-table-action .button {
    min-width: 0;
    height: 2.15rem;
    padding: 0 0.9rem;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.pagination-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.danger-panel {
    border-color: hsl(0 72.2% 45% / 0.35);
}

.danger-panel .eyebrow {
    color: hsl(var(--destructive));
}

.transcription-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: 1rem;
    align-items: start;
    min-height: 0;
}

.transcription-dashboard {
    align-items: stretch;
}

.transcription-layout-compact {
    gap: 0.75rem;
}

.transcription-upload-panel {
    display: grid;
    align-self: start;
    height: auto;
    min-height: 0;
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

.transcription-upload-panel.form-grid {
    gap: 0.75rem;
    padding: 0.875rem;
}

.compact-field {
    gap: 0.25rem;
}

.compact-field label {
    font-size: 0.8125rem;
}

.field-centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.field-centered .help-text {
    margin-top: 0.125rem;
}

.compact-toggle-field {
    align-content: start;
}

.field-centered-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    min-width: 0;
}

.field-centered-toggle.checkbox-field {
    grid-template-columns: none;
    gap: 0.75rem;
    padding-top: 1.5rem;
}

.field-centered-toggle input[type="checkbox"] {
    margin: 0;
}

.field-centered-toggle label {
    margin: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.field-centered select,
.field-centered input,
.field-centered textarea {
    max-width: 100%;
}

.transcription-checkbox-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.625rem;
    min-height: 2.5rem;
    line-height: 1.35;
}

.transcription-checkbox-row input[type="checkbox"] {
    margin: 0;
    align-self: start;
}

.transcription-checkbox-row span {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    margin: 0;
    align-self: start;
}

.transcription-upload-panel .field {
    min-width: 0;
}

.transcription-upload-panel.drag-active {
    border-color: hsl(var(--ring));
    box-shadow:
        0 0 0 3px hsl(var(--ring) / 0.16),
        0 1px 2px hsl(var(--foreground) / 0.04);
}

.drop-hint {
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
    line-height: 1.35;
}

.transcription-progress {
    display: grid;
    gap: 0.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 0.75rem;
}

.transcription-progress-compact {
    gap: 0.375rem;
    padding: 0.625rem 0.75rem;
}

.transcription-progress[hidden] {
    display: none;
}

.transcription-job-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
}

.transcription-job-meta-compact {
    gap: 0.25rem;
}

.transcription-meta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    padding: 0.18rem 0.35rem;
}

.transcription-job-meta-compact .transcription-meta-card {
    gap: 0.4rem;
    min-height: 0;
    padding: 0.14rem 0.35rem;
}

.transcription-meta-label {
    color: hsl(var(--muted-foreground));
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 0.9;
    white-space: nowrap;
}

.transcription-meta-card strong {
    font-size: 0.75rem;
    line-height: 0.9;
    white-space: nowrap;
}

.transcription-primary-actions {
    justify-content: space-between;
}

.transcription-primary-actions-compact {
    gap: 0.375rem;
    padding-top: 0;
}

.transcription-primary-actions-compact .button {
    height: 2.25rem;
    padding: 0 0.875rem;
}

.transcription-progress-compact .transcription-primary-actions-compact {
    gap: 0.5rem;
}

.transcription-progress-compact .transcription-primary-actions-compact .button {
    height: 2rem;
    padding: 0 0.75rem;
}

.button-destructive-secondary {
    border-color: hsl(0 72.2% 45% / 0.35);
    color: hsl(0 72.2% 35%);
}

.button-destructive-secondary:hover {
    background: hsl(0 84.2% 97%);
}

.transcription-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 500;
}

.transcription-progress-header strong {
    font-size: 0.8125rem;
    font-weight: 600;
}

.transcription-progress-compact .transcription-progress-header {
    gap: 0.75rem;
    font-size: 0.8125rem;
}

.transcription-progress-compact .transcription-progress-header strong {
    font-size: 0.75rem;
}

.transcription-progress-track {
    width: 100%;
    height: 0.625rem;
    overflow: hidden;
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    background: hsl(var(--background));
}

.transcription-progress-compact .transcription-progress-track {
    height: 0.5rem;
}

.transcription-progress-track span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: hsl(var(--primary));
    transition: width 180ms ease;
}

.transcription-output {
    display: grid;
    align-self: start;
    height: auto;
    min-height: 0;
    gap: 1rem;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.transcription-layout>.transcription-output {
    min-height: 0;
}

.transcription-dashboard-output {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.transcription-dashboard-output-compact {
    gap: 0.75rem;
    padding: 0.875rem;
}

.panel-subsection {
    display: grid;
    gap: 0.75rem;
}

.transcription-console-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
    gap: 0.75rem;
    align-items: start;
}

.transcription-console-grid-single {
    grid-template-columns: 1fr;
}

.transcription-terminal-header,
.transcription-stream-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.transcription-terminal-log,
.transcription-debug-output {
    margin: 0;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.8125rem;
    line-height: 1.55;
    padding: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.transcription-terminal-log {
    min-height: 124px;
    max-height: 172px;
    overflow: auto;
}

.transcription-debug-output {
    min-height: 124px;
    max-height: 172px;
    overflow: auto;
}

.terminal-state {
    display: inline-flex;
    min-height: 1.75rem;
    align-items: center;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--secondary));
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
}

.terminal-state-running {
    border-color: hsl(var(--ring));
    color: var(--brand-accent);
}

.terminal-state-success {
    border-color: hsl(142 76% 82%);
    background: hsl(138 76% 97%);
    color: hsl(142 72% 25%);
}

.terminal-state-stopped {
    border-color: hsl(42 85% 78%);
    background: hsl(46 100% 96%);
    color: hsl(28 86% 30%);
}

.terminal-state-failed {
    border-color: hsl(0 84.2% 85%);
    background: hsl(0 84.2% 97%);
    color: hsl(0 72.2% 35%);
}

.transcription-output-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0;
}

.transcription-output-header>div {
    display: grid;
    gap: 0.35rem;
}

.status-pill {
    display: inline-flex;
    min-height: 1.75rem;
    align-items: center;
    border: 1px solid hsl(142 76% 82%);
    border-radius: var(--radius);
    background: hsl(138 76% 97%);
    color: hsl(142 72% 25%);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
}

.status-muted {
    border-color: hsl(var(--border));
    background: hsl(var(--secondary));
    color: hsl(var(--muted-foreground));
}

.transcription-output textarea:not(.copy-source) {
    min-height: 380px;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
    line-height: 1.55;
    resize: vertical;
}

.copy-source {
    position: absolute;
    width: 1px;
    min-height: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.transcription-output textarea.copy-source {
    width: 1px;
    min-height: 1px;
    height: 1px;
    padding: 0;
}

.transcription-preview {
    display: flex;
    height: auto;
    min-height: 0;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius);
    background: hsl(var(--background));
    padding: 1rem;
}

.transcription-preview-live {
    flex: 0 1 auto;
    min-height: 18rem;
    max-height: min(32rem, 56vh);
}

.drop-hint:empty,
.help-text:empty {
    display: none;
}

.transcription-preview-section {
    display: grid;
    align-content: start;
    gap: 0.75rem;
}

.transcription-preview-section h3 {
    font-size: 0.875rem;
    line-height: 1.25;
}

.transcription-preview-section>p,
.transcript-fallback {
    color: hsl(var(--foreground));
    line-height: 1.6;
}

.transcript-output-surface {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
}

.transcript-stream-output {
    margin: 0;
    min-height: auto;
    flex: 1 1 auto;
    border-radius: var(--radius);
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0.875rem;
    border: 1px solid hsl(var(--border));
}

.transcript-stream-output-placeholder {
    display: grid;
    place-items: center;
}

.transcript-chunks {
    display: grid;
    align-content: start;
    gap: 0.75rem;
    width: 100%;
}

.transcript-chunk {
    display: grid;
    align-content: start;
    gap: 0.5rem;
    border-left: 3px solid hsl(var(--primary));
    min-height: 0;
    padding-left: 0.875rem;
}

.transcript-chunk-meta {
    color: hsl(var(--muted-foreground));
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.75rem;
    line-height: 1.3;
}

.transcript-chunk p {
    margin: 0;
    color: hsl(var(--foreground));
    font-size: 0.9375rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.speaker-turns {
    display: grid;
    align-content: start;
    align-self: start;
    gap: 0.875rem;
    width: 100%;
}

.speaker-turn {
    display: grid;
    align-content: start;
    gap: 0.5rem;
    border-left: 3px solid hsl(var(--primary));
    min-height: 0;
    padding-left: 0.875rem;
}

.speaker-turn-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.speaker-turn-meta strong {
    font-size: 0.875rem;
}

.speaker-turn-meta span {
    color: hsl(var(--muted-foreground));
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.75rem;
}

.speaker-turn p {
    font-size: 0.9375rem;
    line-height: 1.65;
    margin: 0;
}

.speaker-turn p + p,
.transcript-chunk p + p {
    padding-top: 0.45rem;
    border-top: 1px solid hsl(var(--border) / 0.45);
}

.output-placeholder {
    display: grid;
    min-height: 380px;
    place-items: center;
    border: 1px dashed hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.transcription-actions {
    justify-content: flex-end;
    gap: 0.375rem;
    padding-top: 0;
    padding-inline: 1rem;
}

.transcription-actions .button {
    height: 2.125rem;
    padding: 0 0.8rem;
}

.transcription-debug-details {
    margin: 0 1rem;
    min-width: 0;
    min-height: 0;
    max-height: 200px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    overflow: auto;
    padding: 0.625rem 0.75rem;
}

.transcription-debug-details summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
}

.transcription-debug-details[open] summary {
    margin-bottom: 0.75rem;
}

.transcription-debug-details .panel-subsection {
    min-width: 0;
}

.transcription-debug-details .transcription-terminal-log,
.transcription-debug-details .transcription-debug-output {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 96px;
    max-height: 160px;
}

.output-feedback {
    min-height: 1.25rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
    line-height: 1.35;
    text-align: right;
    padding: 0 1rem 1rem;
}

.output-feedback-error {
    color: hsl(0 72.2% 35%);
}

.audio-transcription-page {
    color: hsl(var(--foreground));
}

.transcription-studio {
    position: relative;
    overflow: hidden;
}

.transcription-studio::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(54% - 0.5px);
    width: 1px;
    background: hsl(var(--border));
    pointer-events: none;
}
.transcription-section-label {
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.transcription-studio-body {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
    align-items: stretch;
    min-height: 0;
}

.transcription-studio-form,
.transcription-studio-output {
    min-width: 0;
    min-height: 0;
    padding: 1rem;
}

.transcription-studio-form {
    display: grid;
    gap: 1rem;
}

.transcription-card-section {
    display: grid;
    gap: 0.5rem;
}

.transcription-section-label {
    font-size: 0.75rem;
}

.transcription-studio-form select,
.transcription-studio-form textarea {
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.9375rem;
    line-height: 1.5;
    padding: 0.75rem 0.875rem;
}

.transcription-studio-form textarea {
    min-height: 9rem;
    resize: vertical;
}

.transcription-studio-form textarea::placeholder {
    color: hsl(var(--muted-foreground));
}

.transcription-studio-form select {
    min-height: 2.75rem;
    appearance: auto;
}

.transcription-studio-form .help-text,
.transcription-studio-form .field-error,
.transcription-status-copy,
.audio-transcription-page .output-feedback {
    color: hsl(var(--muted-foreground));
}

.transcription-file-picker {
    display: flex;
    min-height: 3.5rem;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
    background: hsl(var(--background));
    cursor: pointer;
    padding: 0.625rem 0.75rem;
}

.transcription-file-picker-disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.transcription-file-button {
    display: inline-flex;
    height: var(--control-height);
    align-items: center;
    justify-content: center;
    border: 1px solid hsl(var(--primary));
    border-radius: var(--radius);
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0 1rem;
    white-space: nowrap;
    transition:
        background-color 120ms ease,
        border-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease;
}

.transcription-file-picker:hover .transcription-file-button {
    background: var(--brand-accent-hover);
}

.transcription-file-name {
    color: hsl(var(--foreground));
    font-size: 0.9375rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.transcription-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.transcription-inline-option {
    gap: 0.375rem;
}

.transcription-inline-option .transcription-checkbox-row {
    min-height: 0;
    gap: 0.625rem;
}

.transcription-inline-option .transcription-checkbox-row input[type="checkbox"] {
    accent-color: hsl(var(--primary));
}

.transcription-inline-option .transcription-checkbox-row span {
    color: hsl(var(--foreground));
    font-size: 0.875rem;
}

.transcription-submit-row {
    display: grid;
    gap: 0.375rem;
    align-items: start;
    padding-top: 0;
}

.transcription-submit-button {
    width: fit-content;
    min-height: auto;
    padding: 0 1.25rem;
}

.transcription-status-copy {
    font-size: 0.875rem;
}

.transcription-progress-studio {
    gap: 0.5rem;
    border: 0;
    background: transparent;
    padding: 0;
}

.transcription-progress-studio .transcription-progress-header {
    color: hsl(var(--foreground));
    font-size: 0.875rem;
}

.transcription-studio-form.drag-active {
    background: hsl(var(--secondary) / 0.35);
    box-shadow: inset 0 0 0 1px hsl(var(--ring));
}

.transcription-studio-output {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    align-self: stretch;
    min-height: 0;
    overflow: hidden;
}

.transcription-preview-studio {
    height: 32rem;
    min-height: 32rem;
    max-height: 32rem;
    flex: 0 0 auto;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    padding: 0.875rem;
}

.transcription-preview-studio .transcript-stream-output,
.transcription-preview-studio .transcript-chunks,
.transcription-preview-studio .speaker-turns {
    width: 100%;
}

.transcription-preview-studio .transcript-stream-output {
    min-height: 100%;
    border: 0;
    background: transparent;
    color: hsl(var(--foreground));
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.7;
    padding: 0;
}

.transcription-preview-studio .speaker-turn {
    border-left-color: hsl(var(--primary));
}

.transcription-preview-studio .speaker-turn p,
.transcription-preview-studio .speaker-turn-meta strong {
    color: hsl(var(--foreground));
}

.transcription-preview-studio .speaker-turn-meta span {
    color: hsl(var(--muted-foreground));
}

.transcription-actions-studio {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.625rem;
    padding: 0;
}

.transcription-actions-studio .button {
    min-height: var(--control-height);
}

.audio-transcription-page .transcription-debug-details {
    align-self: end;
    margin: auto 0 0;
}

.audio-transcription-page .output-feedback {
    padding: 0;
    text-align: left;
}

.output-feedback:empty {
    display: none;
}

.site-footer {
    min-height: 56px;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--footer-background));
}

.app-shell-authenticated .main,
.app-shell-authenticated .footer-inner {
    width: min(1280px, calc(100% - 3rem));
}

body.workflow-page .app-shell-authenticated .main {
    width: 100%;
    max-width: none;
    margin: 0;
}

body.workflow-page .app-shell,
body.workflow-page .app-shell-main,
body.workflow-page .app-shell-authenticated,
body.workflow-page .main {
    width: 100% !important;
    max-width: none !important;
}

body.workflow-page {
    overflow-y: auto;
}

body.workflow-page .main {
    margin: 0 !important;
    padding: 0 !important;
}

body.workflow-page .app-shell {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
}

.footer-inner {
    display: flex;
    width: min(1040px, calc(100% - 2rem));
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto;
    color: hsl(var(--footer-foreground));
    font-size: 0.875rem;
}

.footer-links {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.footer-links a {
    color: hsl(var(--footer-foreground));
    font-weight: 500;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--brand-accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}

@media (max-width: 1360px) {

    .topbar .nav-link-manage-users {
        display: none;
    }
}

@media (max-width: 1260px) {

    .topbar .nav-link-transcribe-audio {
        display: none;
    }
}

@media (max-width: 1180px) {

    .topbar .nav-link-upload-meeting {
        display: none;
    }
}

@media (max-width: 1080px) {

    .topbar .nav-link-password-manager {
        display: none;
    }
}

@media (max-width: 980px) {

    .topbar .nav-link-docs {
        display: none;
    }
}

@media (max-width: 880px) {

    .topbar .header-profile-button {
        padding-right: 0.25rem;
    }
}

@media (max-width: 780px) {

    .app-shell-authenticated {
        display: flex;
    }

    .sidebar {
        display: none;
    }

    .app-shell-authenticated .topbar .brand,
    .app-shell-authenticated .topbar .nav-actions {
        display: inline-flex;
    }

    .topbar .nav-actions {
        display: none;
    }

    .mobile-nav-menu {
        display: block;
        position: static;
    }

    .mobile-nav-menu > summary {
        display: inline-flex;
    }
}

@media (max-width: 560px) {

}

@media (max-width: 760px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        height: 64px;
        gap: 0.625rem;
        padding: 0.75rem;
    }

    .topbar .brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar .brand-mark {
        width: 1.875rem;
        height: 1.875rem;
    }

    .topbar .brand-logo {
        width: 1.625rem;
        height: 1.625rem;
    }

    .footer-inner {
        min-height: 56px;
        padding: 0.75rem 0;
    }

    .main {
        padding: 1rem 0;
    }

    .auth-layout {
        min-height: calc(100vh - 112px);
    }

    .error-layout {
        min-height: auto;
    }

    .mobile-nav-panel {
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 1rem;
        z-index: 20;
        display: grid;
        width: min(20rem, calc(100vw - 2rem));
        max-height: calc(100dvh - 5rem);
        overflow: auto;
        gap: 0.5rem;
        align-items: stretch;
        padding: 0.75rem;
        border: 1px solid hsl(var(--border));
        border-radius: var(--radius);
        background: hsl(var(--card));
        box-shadow: 0 12px 32px hsl(var(--foreground) / 0.12);
    }

    .mobile-nav-panel .button,
    .nav-link {
        justify-content: center;
        text-align: center;
        width: 100%;
    }

    .mobile-nav-panel .header-profile {
        width: 100%;
        justify-content: center;
        padding-right: 0.625rem;
    }

    .grid,
    .form-grid,
    .transcription-layout,
    .transcription-job-meta,
    .transcription-console-grid {
        grid-template-columns: 1fr;
    }

    .users-filter-bar {
        grid-template-columns: 1fr;
    }

    .users-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-actions {
        width: 100%;
    }

    .pagination-actions .button {
        flex: 1 1 0;
    }

    .transcription-layout {
        gap: 0.75rem;
    }

    .transcription-studio {
        border-radius: var(--radius);
    }

    .transcription-studio-body {
        grid-template-columns: 1fr;
    }

    .transcription-studio::after {
        display: none;
    }

    .transcription-studio-form,
    .transcription-studio-output {
        padding: 1.25rem;
    }

    .transcription-studio-form {
        border-right: 0;
        border-bottom: 1px solid hsl(var(--border));
    }

    .transcription-file-picker {
        flex-direction: column;
        align-items: flex-start;
    }

    .transcription-file-button,
    .transcription-submit-button {
        width: 100%;
    }

    .transcription-preview-studio {
        min-height: 20rem;
        height: 20rem;
        max-height: 20rem;
        border-radius: var(--radius);
    }

    .transcription-actions-studio {
        grid-template-columns: 1fr;
    }

    .transcription-upload-panel.form-grid,
    .transcription-dashboard-output-compact {
        padding: 0.75rem;
    }

    .transcription-upload-panel textarea {
        min-height: 9.5rem;
        max-height: none;
        resize: vertical;
    }

    .transcription-progress-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .transcription-primary-actions,
    .transcription-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .transcription-actions {
        gap: 0.75rem;
    }

    .transcription-primary-actions .button,
    .transcription-actions .button {
        width: 100%;
    }

    .transcription-actions .button + .button {
        margin-top: 0.75rem;
    }

    .transcription-output {
        gap: 0.75rem;
    }

    .transcription-output-header {
        padding: 0.75rem 0.75rem 0;
    }

    .transcription-preview {
        padding: 0.75rem;
    }

    .transcription-preview-live {
        min-height: 14rem;
        max-height: min(24rem, 42vh);
    }

    .transcript-stream-output {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }

    .transcription-actions {
        padding-inline: 0.75rem;
    }

    .transcription-debug-details {
        margin: 0 0.75rem;
        max-height: none;
    }

    .output-feedback {
        padding: 0 0.75rem 0.75rem;
        text-align: left;
    }

    .header-profile {
        width: 100%;
        justify-content: center;
    }

    .header-profile-menu {
        margin-left: auto;
    }

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

@media (max-width: 560px) {

    .topbar .brand {
        gap: 0.625rem;
    }

    .topbar .brand strong {
        font-size: 0.95rem;
    }

    .topbar .brand small {
        display: none;
    }

    .mobile-nav-menu > summary {
        min-width: var(--control-height);
        padding-inline: 0.85rem;
    }
}
