:root {
    color-scheme: light;
    --ink: #17243a;
    --muted: #647286;
    --line: #e2e8ed;
    --surface: #ffffff;
    --surface-soft: #f5f8f8;
    --surface-blue: #f0f5f9;
    --navy: #12233a;
    --navy-soft: #253b54;
    --mint: #b9f4d0;
    --teal: #167b6e;
    --teal-dark: #11675c;
    --danger: #a53a42;
    --danger-soft: #fff2f2;
    --shadow: 0 12px 36px rgba(18, 35, 58, .08);
    --radius: 16px;
    --radius-small: 10px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #f7f9fa; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #f7f9fa; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--teal-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: #0c584e; }
button { color: inherit; }
img, svg { display: block; }
::selection { color: var(--navy); background: #cbf3dd; }
:focus-visible { outline: 3px solid #378bdf; outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-160%); color: white; background: var(--navy); border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 10; top: 0; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-inner { width: min(1200px, calc(100% - 48px)); min-height: 68px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; color: var(--navy); text-decoration: none; font-size: 16px; font-weight: 750; letter-spacing: -.025em; }
.brand img { width: 34px; height: 34px; }
.primary-nav { display: flex; align-items: center; gap: 22px; }
.primary-nav > a:not(.button) { color: #48586b; text-decoration: none; font-size: 14px; font-weight: 580; }
.primary-nav > a[aria-current="page"] { color: var(--teal-dark); }
.primary-nav > a:not(.button):hover { color: var(--teal-dark); }
.primary-nav .nav-account { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout { margin: 0; }
.menu-toggle { display: none; }
.main-content { min-height: calc(100vh - 164px); }
.page-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 76px; }
.narrow-shell { width: min(620px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 80px; }
.eyebrow { margin: 0 0 8px; color: var(--teal-dark); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--navy); letter-spacing: -.035em; }
h1 { margin-bottom: 10px; font-size: clamp(29px, 4vw, 42px); line-height: 1.12; font-weight: 750; }
h2 { margin-bottom: 10px; font-size: 21px; line-height: 1.25; }
h3 { margin-bottom: 8px; font-size: 17px; line-height: 1.3; }
.intro-copy { max-width: 640px; margin: 0; color: var(--muted); font-size: 16px; }
.page-heading, .intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-heading > div, .intro-row > div { min-width: 0; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-size: 14px; line-height: 1.3; font-weight: 700; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-primary { color: #10332f; background: var(--mint); border-color: #9de8be; }
.button-primary:hover { color: #102b28; background: #a5edc2; }
.button-secondary { color: var(--navy); background: #fff; border-color: #cfd9e0; }
.button-secondary:hover { color: var(--navy); background: #f5f8fa; border-color: #aab9c5; }
.button-quiet { color: #45566b; background: transparent; border-color: transparent; }
.button-quiet:hover { color: var(--navy); background: #edf2f5; }
.button-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button-danger:hover { color: #fff; background: #882e35; }
.button-small { min-height: 38px; padding: 7px 12px; font-size: 13px; }
.button-wide { width: 100%; }
.text-danger { color: var(--danger); }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 50%; color: #617185; background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--teal-dark); background: #edf7f3; }
.favorite-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.favorite-button.is-saved { color: #b44655; }
.favorite-button.is-saved svg { fill: #f5dce0; }

.filter-panel { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 4px 14px rgba(18,35,58,.035); }
.search-field { position: relative; flex: 1 1 360px; min-width: 180px; }
.search-field input { width: 100%; padding-left: 40px; }
.search-icon { position: absolute; z-index: 1; top: 14px; left: 14px; width: 14px; height: 14px; border: 2px solid #748396; border-radius: 50%; }
.search-icon::after { position: absolute; right: -5px; bottom: -3px; width: 6px; height: 2px; content: ""; transform: rotate(45deg); background: #748396; border-radius: 2px; }
input, textarea, select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #cbd5de; border-radius: 8px; }
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #8290a0; opacity: 1; }
input:hover, textarea:hover, select:hover { border-color: #a9b8c5; }
input:focus, textarea:focus, select:focus { border-color: #2a7f74; outline: 3px solid rgba(43, 134, 121, .14); }
select { padding-right: 35px; cursor: pointer; }
.filter-control { flex: 0 1 185px; }
.filter-sort { flex-basis: 165px; }
.tag-filter-row, .tag-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag-filter-row { margin: 14px 0 32px; }
.tag-chip { display: inline-flex; align-items: center; min-height: 29px; padding: 4px 10px; color: #506177; background: #f0f4f6; border-radius: 99px; font-size: 12px; line-height: 1.25; text-decoration: none; }
a.tag-chip:hover, .tag-chip.is-selected { color: #10584e; background: #ddf5e8; }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.results-heading p { margin: 0; }
.results-heading strong { color: var(--ink); }
.results-heading a { font-weight: 650; text-decoration: none; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.prompt-card { min-width: 0; min-height: 250px; display: flex; flex-direction: column; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.prompt-card:hover { border-color: #c4d6d5; box-shadow: var(--shadow); transform: translateY(-2px); }
.card-topline { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-topline form { margin: -4px -8px 0 0; }
.category-label { color: var(--teal-dark); font-size: 12px; font-weight: 750; }
.prompt-card h2 { margin: 11px 0 8px; font-size: 19px; line-height: 1.32; overflow-wrap: anywhere; }
.prompt-card h2 a { color: var(--navy); text-decoration: none; }
.prompt-card h2 a:hover { color: var(--teal-dark); }
.card-summary { display: -webkit-box; margin: 0 0 15px; color: #59697c; font-size: 14px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.prompt-card .tag-list { margin-top: auto; padding-top: 8px; }
.prompt-card .tag-chip { min-height: 26px; font-size: 11px; }
.card-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 17px; color: var(--teal-dark); font-size: 13px; font-weight: 750; text-decoration: none; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 30px 0; color: var(--muted); font-size: 13px; }
.empty-state { display: grid; justify-items: center; padding: 54px 24px; text-align: center; background: #fff; border: 1px dashed #cbd6de; border-radius: 16px; }
.empty-state h2 { margin: 10px 0 6px; }
.empty-state p { max-width: 440px; margin-bottom: 19px; color: var(--muted); }
.empty-mark { width: 42px; height: 42px; display: grid; place-items: center; color: #185e55; background: #dff5e8; border-radius: 13px; font-size: 23px; }
.compact-empty { padding: 25px 20px; border: 0; background: var(--surface-soft); }
.compact-empty h3 { margin: 0 0 4px; }
.compact-empty p { margin: 0 0 10px; font-size: 13px; }
.join-strip { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 46px; padding: 24px 28px; background: var(--navy); border-radius: 16px; }
.join-strip h2 { margin-bottom: 4px; color: #fff; font-size: 20px; }
.join-strip p { max-width: 540px; margin: 0; color: #c0cfda; font-size: 14px; }

.flash-stack { position: relative; z-index: 2; width: min(1120px, calc(100% - 48px)); margin: 18px auto -12px; }
.notice { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 14px; }
.notice + .notice { margin-top: 8px; }
.notice-success { color: #145649; background: #e8f7ef; border-color: #bfe7d2; }
.notice-error { color: #7f2930; background: #fff0f0; border-color: #f0c8cc; }
.notice-info { color: #294d6a; background: #edf5fb; border-color: #c9deed; }
.notice-dismiss { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 50%; color: inherit; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
.notice-dismiss:hover { background: rgba(0,0,0,.06); }
.site-footer { color: #d0dbe4; background: var(--navy); }
.footer-inner { width: min(1120px, calc(100% - 48px)); min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 auto; }
.footer-inner p { display: grid; gap: 2px; margin: 0; }
.footer-inner p strong { color: #fff; font-size: 14px; }
.footer-inner p span { color: #aebdca; font-size: 12px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-inner nav a { color: #d0dbe4; font-size: 12px; text-decoration: none; }
.footer-inner nav a:hover { color: #fff; text-decoration: underline; }

.auth-shell { padding-top: 54px; }
.auth-card, .notice-card { padding: 30px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.auth-card h1, .notice-card h1 { font-size: 30px; }
.muted-copy, .notice-card > p { margin: 0 0 24px; color: var(--muted); }
.stack-form { display: grid; gap: 16px; }
.stack-form > label, .editor-form label, .delete-form label { display: grid; gap: 6px; color: #394b60; font-size: 13px; font-weight: 700; }
.stack-form small, .editor-form small, .field-help { color: var(--muted); font-size: 12px; font-weight: 450; }
.password-control { position: relative; display: flex; }
.password-control input { padding-right: 68px; }
.password-toggle { position: absolute; top: 0; right: 4px; min-width: 58px; height: 44px; border: 0; color: var(--teal-dark); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.auth-extra { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-top: 20px; font-size: 13px; }
.auth-extra details { flex: 1 1 210px; text-align: right; }
.auth-extra summary { color: #526379; cursor: pointer; }
.inline-email-form { display: grid; gap: 10px; margin-top: 12px; text-align: left; }
.inline-email-form label { display: grid; gap: 5px; font-size: 12px; font-weight: 650; }
.auth-switch { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.notice-card { padding: 38px; }
.notice-card .button { margin-top: 4px; }

.account-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 18px; }
.panel { min-width: 0; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.panel-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0 0 4px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.account-link { margin: 18px 0 0; font-size: 13px; }
.inline-note { margin: 12px 0 0; padding: 10px 12px; color: #30556d; background: #edf5fb; border-radius: 8px; font-size: 12px; }
.owned-prompts { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.owned-prompts li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #edf0f2; }
.owned-prompts li:last-child { border-bottom: 0; }
.owned-prompts li > div { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.owned-prompts strong { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.owned-prompts a { flex: 0 0 auto; font-size: 12px; font-weight: 700; text-decoration: none; }
.status-pill, .role-badge, .count-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-published, .status-active { color: #145c4d; background: #e4f6ed; }
.status-draft, .status-open { color: #8c5a15; background: #fff2d6; }
.status-unpublished, .status-suspended { color: #59687a; background: #edf1f4; }
.role-badge { min-height: 21px; color: #3e4c69; background: #eceffa; font-size: 10px; }
.danger-zone { margin-top: 34px; padding: 17px 20px; border: 1px solid #efccce; border-radius: 12px; background: var(--danger-soft); }
.danger-zone summary { color: var(--danger); font-weight: 700; cursor: pointer; }
.danger-zone > p { margin: 14px 0; color: #674b4d; font-size: 13px; }
.delete-form { display: flex; align-items: flex-end; gap: 12px; }
.delete-form label { flex: 1; }

.editor-heading { align-items: center; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .75fr); align-items: start; gap: 18px; }
.editor-form { display: grid; gap: 16px; }
.editor-section { display: grid; gap: 15px; }
.editor-section > label { margin: 0; }
.step-number { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; color: #176358; background: #e0f5e9; border-radius: 9px; font-size: 13px; font-weight: 800; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-help { margin: 0; line-height: 1.5; }
.placeholder-config { display: grid; gap: 11px; }
.placeholder-empty { padding: 13px 15px; color: var(--muted); background: var(--surface-soft); border-radius: 9px; font-size: 13px; }
.placeholder-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 13px; background: var(--surface-soft); border: 1px solid #e8eef0; border-radius: 10px; }
.placeholder-row > strong { grid-column: 1 / -1; color: var(--teal-dark); font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.placeholder-row label { display: grid; gap: 5px; font-size: 11px; }
.placeholder-row label input { min-height: 40px; padding: 8px 10px; font-size: 13px; }
.placeholder-check { display: flex !important; align-items: center; gap: 7px !important; color: #526379; }
.placeholder-check input { width: 17px; height: 17px; min-height: 17px; margin: 0; accent-color: var(--teal); }
.editor-actions { position: sticky; z-index: 2; bottom: 10px; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 22px rgba(18,35,58,.1); backdrop-filter: blur(8px); }
.preview-column { position: sticky; top: 88px; display: grid; gap: 14px; }
.live-preview { padding: 19px; }
.preview-paper { padding: 14px; background: #f8fafb; border: 1px solid #e7ecef; border-radius: 10px; }
.preview-label { color: #7d8b98; font-size: 10px; letter-spacing: .1em; font-weight: 800; }
.preview-paper pre, .original-template, .completed-prompt { margin: 8px 0 0; color: #34475d; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-paper pre { max-height: 340px; overflow: auto; }
.share-link-card { display: grid; gap: 4px; padding: 16px 19px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; }
.share-link-card > span { color: var(--muted); }
.share-link-card a { font-weight: 700; text-decoration: none; }

.prompt-detail { padding-top: 30px; }
.private-banner { margin-bottom: 18px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; color: #8a97a4; font-size: 12px; }
.breadcrumbs a { color: #607187; text-decoration: none; }
.prompt-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(350px, .9fr); align-items: start; gap: 24px; }
.prompt-main { display: grid; gap: 16px; min-width: 0; }
.prompt-heading { padding: 0 2px 6px; }
.prompt-heading h1 { max-width: 760px; margin: 8px 0 12px; overflow-wrap: anywhere; }
.prompt-summary { max-width: 760px; margin: 0 0 15px; color: #506176; font-size: 17px; line-height: 1.55; }
.prompt-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
.prompt-tags { margin-top: 14px; }
.prompt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.prompt-toolbar form { margin: 0; }
.how-to-panel h2 { margin-bottom: 9px; }
.how-to-panel p { margin-bottom: 0; color: #4c5d71; }
.compatibility-note { margin-top: 13px !important; padding-top: 12px; border-top: 1px solid #edf0f2; font-size: 13px; }
.template-panel { padding: 19px; }
.template-panel .panel-heading { align-items: center; justify-content: space-between; }
.template-panel .panel-heading .eyebrow { margin-bottom: 2px; }
.template-panel .panel-heading h2 { font-size: 17px; }
.original-template { max-height: 400px; padding: 14px; overflow: auto; background: #f8fafb; border: 1px solid #e7ecef; border-radius: 9px; font-size: 12px; }
.copy-feedback { min-height: 19px; margin: 8px 0 0; color: var(--teal-dark); font-size: 12px; font-weight: 650; }
.composer-panel { position: sticky; top: 90px; padding: 22px; box-shadow: 0 14px 35px rgba(18,35,58,.07); }
.composer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-heading h2 { margin-bottom: 5px; font-size: 21px; }
.composer-spark { width: 36px; height: 36px; display: grid; place-items: center; color: #175f56; background: #dff5e8; border-radius: 11px; font-size: 19px; }
.composer-intro { margin: 0 0 17px; color: var(--muted); font-size: 12px; }
.composer-fields { display: grid; gap: 13px; }
.composer-field { display: grid; gap: 5px; color: #394b60; font-size: 12px; font-weight: 700; }
.composer-field textarea, .composer-field input { min-height: 42px; padding: 9px 10px; font-size: 13px; font-weight: 450; }
.composer-field textarea { min-height: 78px; }
.required-mark { color: #b3424c; }
.completed-section { margin-top: 19px; padding-top: 16px; border-top: 1px solid #e8edf0; }
.completed-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.completed-heading h3 { margin: 0; font-size: 14px; }
.completed-prompt { max-height: 260px; padding: 13px; overflow: auto; background: #f7faf9; border: 1px solid #e0eae5; border-radius: 9px; }
.completed-section .field-help { margin: 8px 0 12px; }
.report-panel { padding: 16px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.report-panel summary { color: #53647a; font-size: 13px; font-weight: 700; cursor: pointer; }
.report-panel > p { margin: 12px 0; color: var(--muted); font-size: 12px; }
.report-form { max-width: 480px; }

.admin-jump-nav { position: sticky; z-index: 3; top: 68px; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin: 0 0 30px; background: rgba(247,249,250,.96); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(8px); }
.admin-jump-nav a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 10px; color: #4a5b70; background: #fff; border: 1px solid #e3e9ed; border-radius: 8px; font-size: 12px; font-weight: 650; text-decoration: none; }
.admin-jump-nav a:hover { color: var(--teal-dark); border-color: #b8d5cf; }
.admin-jump-nav span, .count-pill { min-width: 21px; justify-content: center; color: #50657a; background: #edf2f5; }
.admin-section { padding-top: 10px; margin-bottom: 42px; scroll-margin-top: 128px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.section-heading .eyebrow { margin-bottom: 3px; }
.section-heading h2 { margin: 0; font-size: 23px; }
.admin-list { display: grid; gap: 9px; }
.admin-list-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.admin-item-content { min-width: 0; }
.admin-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 13px; }
.admin-item-top time, .admin-table time { color: var(--muted); font-size: 11px; }
.admin-item-content > a { font-size: 13px; font-weight: 700; text-decoration: none; }
.admin-item-content p { margin: 5px 0 0; color: #5b6b7c; font-size: 12px; overflow-wrap: anywhere; }
.admin-item-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.admin-item-actions form { margin: 0; }
.admin-table-wrap { width: 100%; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.admin-table { width: 100%; min-width: 680px; border-collapse: collapse; text-align: left; }
.admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid #edf0f2; vertical-align: middle; font-size: 12px; }
.admin-table th { color: #687789; background: #f9fbfc; font-size: 11px; font-weight: 750; }
.admin-table td:first-child { max-width: 310px; }
.admin-table td a:not(.table-action) { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; text-decoration: none; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table form { margin: 0; }
.table-action { padding: 6px 8px; color: var(--teal-dark); background: transparent; border: 0; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; }
.table-action:hover { text-decoration: underline; }
.admin-page > .admin-section > .field-help { margin-top: 9px; }
.admin-taxonomy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.admin-taxonomy-grid h3 { margin-bottom: 13px; font-size: 16px; }
.inline-add-form { display: flex; gap: 8px; }
.inline-add-form input { min-height: 40px; }
.taxonomy-list { display: grid; gap: 0; padding: 0; margin: 13px 0 0; list-style: none; }
.taxonomy-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 39px; border-bottom: 1px solid #edf0f2; font-size: 12px; }
.taxonomy-list li:last-child { border-bottom: 0; }
.taxonomy-list small { margin-left: 5px; color: var(--muted); font-size: 10px; }
.taxonomy-list form { margin: 0; }
.taxonomy-list .icon-button { width: 32px; height: 32px; font-size: 19px; }
.settings-form { max-width: 660px; }

.legal-page { padding-top: 48px; }
.legal-page h1 { margin-bottom: 18px; }
.legal-page h2 { margin: 27px 0 8px; font-size: 18px; }
.legal-page p { color: #536479; }
.legal-page .lead { color: #415269; font-size: 17px; }
.legal-updated { margin-top: 30px; padding: 12px 14px; background: #f0f4f6; border-radius: 9px; font-size: 12px; }

@media (max-width: 900px) {
    .header-inner { width: min(100% - 36px, 1120px); }
    .primary-nav { gap: 14px; }
    .page-shell { width: min(100% - 36px, 1120px); }
    .prompt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .prompt-layout { grid-template-columns: minmax(0, 1fr) minmax(310px, .9fr); gap: 16px; }
    .editor-layout { grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr); gap: 14px; }
}
@media (max-width: 720px) {
    .header-inner { min-height: 62px; }
    .menu-toggle { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: var(--navy); background: transparent; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
    .menu-lines, .menu-lines::before, .menu-lines::after { width: 18px; height: 2px; display: block; background: currentColor; border-radius: 2px; }
    .menu-lines { position: relative; }
    .menu-lines::before, .menu-lines::after { position: absolute; left: 0; content: ""; }
    .menu-lines::before { top: -6px; }
    .menu-lines::after { top: 6px; }
    .primary-nav { position: absolute; top: calc(100% + 1px); right: 0; left: 0; display: none; align-items: stretch; gap: 0; padding: 8px 18px 14px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 14px 20px rgba(18,35,58,.08); }
    .primary-nav.is-open { display: flex; flex-direction: column; }
    .primary-nav > a:not(.button) { min-height: 44px; display: flex; align-items: center; padding: 8px 4px; border-bottom: 1px solid #edf0f2; }
    .primary-nav .button { margin-top: 10px; }
    .nav-logout { padding-top: 8px; }
    .nav-logout .button { width: 100%; }
    .page-shell { padding-top: 30px; }
    .page-heading, .intro-row { align-items: flex-start; }
    .prompt-layout, .editor-layout, .account-grid { grid-template-columns: 1fr; }
    .composer-panel, .preview-column { position: static; }
    .preview-column { order: -1; }
    .admin-jump-nav { top: 62px; }
    .admin-section { scroll-margin-top: 125px; }
}
@media (max-width: 560px) {
    body { font-size: 14px; }
    .header-inner, .page-shell, .footer-inner { width: calc(100% - 32px); }
    .narrow-shell { width: calc(100% - 28px); padding-top: 34px; }
    .page-shell { padding-bottom: 54px; }
    .page-heading, .intro-row { display: grid; justify-items: start; gap: 16px; margin-bottom: 21px; }
    h1 { font-size: 30px; }
    .intro-copy { font-size: 14px; }
    .filter-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 9px; }
    .search-field { grid-column: 1 / -1; min-width: 0; }
    .filter-control, .filter-sort { min-width: 0; }
    .filter-panel > .button { width: 100%; }
    .filter-panel > a.button { grid-column: 2; grid-row: 3; }
    .tag-filter-row { margin: 12px 0 24px; }
    .prompt-grid { grid-template-columns: 1fr; gap: 11px; }
    .prompt-card { min-height: 0; padding: 17px; }
    .card-summary { -webkit-line-clamp: 4; }
    .results-heading { align-items: flex-start; }
    .join-strip { align-items: flex-start; flex-direction: column; padding: 20px; margin-top: 30px; }
    .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 12px; padding: 18px 0; }
    .footer-inner nav { gap: 13px; }
    .auth-card, .notice-card { padding: 23px 19px; }
    .auth-card h1, .notice-card h1 { font-size: 27px; }
    .auth-extra { flex-direction: column; }
    .auth-extra details { width: 100%; text-align: left; }
    .form-pair, .admin-taxonomy-grid { grid-template-columns: 1fr; }
    .delete-form { align-items: stretch; flex-direction: column; }
    .editor-actions { bottom: 6px; }
    .editor-actions .button { flex: 1 1 auto; }
    .prompt-detail { padding-top: 22px; }
    .prompt-summary { font-size: 15px; }
    .prompt-toolbar { align-items: stretch; }
    .prompt-toolbar > *, .prompt-toolbar form, .prompt-toolbar form .button { flex: 1 1 auto; }
    .prompt-toolbar > .button, .prompt-toolbar form .button { width: 100%; }
    .panel { padding: 17px; }
    .template-panel { padding: 15px; }
    .template-panel .panel-heading { align-items: flex-start; }
    .template-panel .panel-heading .button { flex: 0 0 auto; }
    .composer-panel { padding: 18px; }
    .admin-jump-nav { gap: 6px; padding: 7px; }
    .admin-jump-nav a { min-height: 34px; padding: 5px 8px; font-size: 11px; }
    .admin-list-item { flex-direction: column; gap: 12px; padding: 14px; }
    .admin-item-actions { justify-content: flex-start; }
    .admin-item-actions .button { min-height: 38px; }
    .admin-page .section-heading h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
