:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #eef3f1;
    --text: #17201c;
    --muted: #66716c;
    --line: #d9e0dc;
    --primary: #146b52;
    --primary-dark: #0d503d;
    --accent: #315f9f;
    --warn: #a05b12;
    --danger: #a43737;
    --radius: 8px;
    --shadow: 0 10px 30px rgba(23, 32, 28, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.brand {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    font-size: 20px;
    font-weight: 800;
    gap: 9px;
}

.logo-mark {
    align-items: center;
    background: var(--primary);
    border-radius: 7px;
    color: #fff;
    display: inline-flex;
    font-size: 14px;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.header-search {
    flex: 0 1 280px;
}

.search-component {
    position: relative;
}

.header-search input {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    min-height: 38px;
    padding: 8px 14px;
    width: 100%;
}

.nav,
.sidebar nav,
.actions,
.row-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.nav-tree {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-tree li {
    position: relative;
}

.nav-tree .nav-tree {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
    left: 0;
    min-width: 190px;
    padding: 8px;
    position: absolute;
    top: 100%;
    z-index: 10;
}

.nav-tree li:hover > .nav-tree {
    display: grid;
}

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 40px;
    padding: 28px;
}

.footer-inner {
    display: grid;
    gap: 14px;
    margin: 0 auto;
    max-width: 1180px;
}

.page {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px;
}

.hero {
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #eef3f1 55%, #f5efe3 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr) 220px;
    min-height: 330px;
    padding: 42px;
}

.home-hero {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    gap: 28px;
    padding: 42px;
}

.home-hero h1,
.search-page h1 {
    font-size: clamp(34px, 6vw, 62px);
    line-height: 1.02;
    margin: 8px 0 14px;
}

.home-hero p {
    color: var(--muted);
    font-size: 18px;
    margin: 0;
    max-width: 760px;
}

.hero-search {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: 760px;
}

.hero-search input {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    font: inherit;
    min-height: 54px;
    padding: 12px 16px;
    width: 100%;
}

.search-dropdown {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
    left: 0;
    margin-top: 8px;
    max-height: min(520px, 70vh);
    overflow-y: auto;
    padding: 12px;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 30;
}

.search-dropdown-section {
    display: grid;
    gap: 8px;
}

.search-dropdown-section > strong,
.search-empty-state > strong {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.search-option,
.search-result-item a {
    align-items: center;
    border-radius: 7px;
    color: var(--text);
    display: grid;
    gap: 10px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 9px;
}

.search-option:hover,
.search-option.is-active,
.search-result-item a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.search-item-icon {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--accent);
    display: inline-flex;
    font-size: 13px;
    font-weight: 850;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.search-option strong,
.search-option small,
.search-result-item strong,
.search-result-item small,
.search-result-item em {
    display: block;
}

.search-option small,
.search-result-item small,
.search-result-item em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.search-empty-state {
    display: grid;
    gap: 8px;
}

.search-empty-state p {
    margin: 0;
}

.search-results-list {
    display: grid;
    gap: 10px;
}

.search-result-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

mark {
    background: #fff1b8;
    border-radius: 4px;
    color: inherit;
    padding: 0 2px;
}

.compact-search {
    margin-top: 18px;
}

.compact-section {
    margin-top: 18px;
}

.section-head {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-head h2 {
    margin: 0;
}

.category-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.category-card a {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    display: grid;
    gap: 8px;
    min-height: 180px;
    padding: 20px;
}

.category-card a:hover {
    border-color: var(--primary);
    color: var(--text);
}

.category-card strong {
    font-size: 20px;
}

.category-card p {
    color: var(--muted);
    margin: 0;
}

.category-card small {
    color: var(--muted);
    margin-top: auto;
}

.category-icon {
    color: var(--accent);
    font-weight: 850;
}

.category-page {
    display: grid;
    gap: 8px;
}

.category-hero {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 18px;
    padding: 32px;
}

.category-hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.02;
    margin: 8px 0 14px;
}

.category-hero p:last-child {
    color: var(--muted);
    font-size: 18px;
    margin: 0;
    max-width: 760px;
}

.category-hero-icon {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--accent);
    display: inline-flex;
    flex: 0 0 64px;
    font-size: 28px;
    font-weight: 850;
    height: 64px;
    justify-content: center;
    width: 64px;
}

.hero h1,
.tool-header h1,
.dashboard-head h1,
.result-page h1 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.02;
    margin: 8px 0 14px;
}

.hero p,
.tool-header p {
    color: var(--muted);
    font-size: 18px;
    max-width: 720px;
}

.hero-panel,
.credit-badge,
.stats-grid > div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.hero-panel strong,
.stats-grid strong {
    display: block;
    font-size: 44px;
}

.eyebrow {
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
    text-transform: uppercase;
}

.section {
    margin-top: 34px;
}

.section h2,
.run-box h2,
.panel h2 {
    font-size: 22px;
    margin: 0 0 16px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chips span {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 14px;
}

.chips a {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 14px;
}

.breadcrumb {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    gap: 8px;
    margin-bottom: 18px;
}

.breadcrumb a::after {
    color: var(--muted);
    content: "/";
    margin-left: 8px;
}

.chips small {
    color: var(--muted);
    margin-left: 4px;
}

.tool-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.tool-card,
.panel,
.run-box,
.tool-content,
.result-box,
.auth-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tool-card {
    display: flex;
    flex-direction: column;
    min-height: 240px;
    padding: 22px;
}

.tool-card h3 {
    font-size: 21px;
    margin: 10px 0 8px;
}

.tool-card p {
    color: var(--muted);
    flex: 1;
}

.tool-meta,
.muted {
    color: var(--muted);
    font-size: 14px;
}

.button,
button {
    align-items: center;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 750;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
}

.button:hover,
button:hover {
    background: var(--primary-dark);
    color: #fff;
}

.button.ghost {
    background: #fff;
    color: var(--primary);
}

.button.small {
    min-height: 34px;
    padding: 7px 12px;
}

.tool-header,
.dashboard-head,
.admin-title {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.account-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}

.account-nav a {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    padding: 9px 12px;
}

.account-nav a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.actions.compact {
    align-items: center;
    gap: 8px;
}

.actions.compact button {
    background: transparent;
    border: 0;
    color: var(--danger);
    cursor: pointer;
    min-height: auto;
    padding: 0;
}

.tool-experience {
    display: grid;
    gap: 22px;
}

.tool-hero {
    display: grid;
    gap: 12px;
}

.tool-hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.02;
    margin: 0;
}

.tool-summary {
    color: var(--muted);
    font-size: 18px;
    margin: 0;
    max-width: 760px;
}

.tool-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-badges span {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    padding: 6px 10px;
}

.tool-section {
    margin-top: 8px;
}

.tool-run-form {
    display: grid;
    gap: 14px;
}

.primary-action {
    justify-self: start;
    min-width: 150px;
}

.result-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
    padding: 22px;
}

.result-panel.is-empty {
    border-style: dashed;
    box-shadow: none;
}

.empty-state h2,
.result-head h2 {
    margin: 0;
}

.empty-state p {
    margin-bottom: 0;
}

.result-head {
    align-items: start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin: 0;
}

.result-meta div {
    background: var(--surface-2);
    border-radius: 7px;
    padding: 7px 10px;
}

.result-meta dt {
    color: var(--muted);
    font-size: 12px;
}

.result-meta dd {
    font-weight: 800;
    margin: 0;
}

.calculation-result {
    display: grid;
    gap: 10px;
    margin: 0;
}

.calculation-result div {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding-bottom: 10px;
}

.calculation-result div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.calculation-result dt {
    color: var(--muted);
    font-weight: 800;
}

.calculation-result dd {
    font-size: 20px;
    font-weight: 850;
    margin: 0;
}

.tool-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.content-body > :first-child,
.tool-content > :first-child {
    margin-top: 0;
}

.content-body > :last-child,
.tool-content > :last-child {
    margin-bottom: 0;
}

.toast {
    background: var(--text);
    border-radius: 7px;
    bottom: 22px;
    box-shadow: var(--shadow);
    color: #fff;
    opacity: 0;
    padding: 10px 14px;
    pointer-events: none;
    position: fixed;
    right: 22px;
    transform: translateY(10px);
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 20;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.credit-badge {
    color: var(--warn);
    font-size: 20px;
    font-weight: 850;
    min-width: 120px;
    text-align: center;
}

.tool-layout {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) 420px;
}

.tool-content,
.run-box,
.result-box,
.auth-box,
.panel {
    padding: 24px;
}

.tool-content h2:first-child {
    margin-top: 0;
}

.form {
    display: grid;
    gap: 16px;
}

.form label {
    color: var(--text);
    display: grid;
    font-size: 14px;
    font-weight: 750;
    gap: 7px;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    font: inherit;
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(49, 95, 159, 0.14);
}

.form small {
    color: var(--muted);
    font-weight: 500;
}

.choice-list {
    display: grid;
    gap: 8px;
}

.choice-list label,
.inline-check {
    align-items: center;
    display: flex !important;
    gap: 8px;
}

.choice-list input,
.inline-check input {
    width: auto;
}

.auth-box {
    margin: 60px auto;
    max-width: 440px;
}

.auth-box h1 {
    margin-top: 0;
}

.alert {
    border-radius: var(--radius);
    margin-bottom: 18px;
    padding: 12px 14px;
}

.alert.success {
    background: #e5f5ed;
    color: #115f43;
}

.alert.error {
    background: #f8e7e7;
    color: var(--danger);
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 720px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.result-page {
    max-width: 900px;
}

.standalone-form {
    max-width: 760px;
}

.result-box {
    font-size: 17px;
    margin: 20px 0;
    white-space: normal;
}

.admin-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: #17201c;
    color: #fff;
    padding: 24px;
}

.sidebar .brand {
    color: #fff;
    display: block;
    margin-bottom: 26px;
}

.sidebar nav {
    align-items: stretch;
    flex-direction: column;
}

.sidebar a {
    border-radius: 7px;
    color: #dfe8e3;
    padding: 10px 12px;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.admin-main {
    min-width: 0;
    padding: 28px;
}

.admin-title h1 {
    margin: 0;
}

.admin-page-header {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.admin-page-header h1 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.05;
    margin: 4px 0 8px;
}

.admin-page-header p {
    color: var(--muted);
    margin: 0;
    max-width: 720px;
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.admin-card h2 {
    margin: 0 0 14px;
}

.admin-tabs {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    padding: 8px;
}

.admin-tabs button {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    min-height: 36px;
    padding: 7px 12px;
}

.admin-tabs button:hover,
.admin-tabs button.is-active {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--text);
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.is-active {
    display: block;
}

.admin-edit-form {
    gap: 0;
}

.admin-edit-form .admin-tab-panel {
    margin-bottom: 18px;
}

.admin-narrow-form {
    max-width: 900px;
}

.form-section-head,
.table-toolbar,
.admin-summary-card {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.form-section-head {
    margin-bottom: 18px;
}

.form-section-head h2,
.form-section-head p,
.table-toolbar h2,
.table-toolbar p {
    margin: 0;
}

.form-section-head p {
    color: var(--muted);
}

.form-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 18px;
}

.admin-checkbox-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    min-height: 42px;
    padding: 10px 12px;
}

.status-badge {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    padding: 5px 9px;
}

.status-badge.active,
.status-badge.success {
    background: #e5f5ed;
    border-color: #b9dfcd;
    color: #115f43;
}

.status-badge.inactive,
.status-badge.failed {
    background: #f8e7e7;
    border-color: #ecc2c2;
    color: var(--danger);
}

.status-badge.draft,
.status-badge.neutral {
    background: #f1f4f2;
    color: var(--muted);
}

.compact-empty {
    background: var(--surface-2);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    padding: 18px;
}

.admin-detail-list {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
}

.admin-detail-list div {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 8px;
    grid-template-columns: 160px minmax(0, 1fr);
    padding-bottom: 10px;
}

.admin-detail-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.admin-detail-list dt {
    color: var(--muted);
    font-weight: 800;
}

.admin-detail-list dd {
    margin: 0;
    word-break: break-word;
}

.stack-actions {
    display: grid;
    gap: 10px;
    min-width: 210px;
}

.mini-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: grid;
    gap: 8px;
    padding: 16px;
}

.compact-cards {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stats-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stats-grid span {
    color: var(--muted);
}

.admin-footer {
    color: var(--muted);
    font-size: 0.85rem;
    padding: 16px 28px;
    text-align: right;
}

.admin-grid {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: 360px minmax(0, 1fr);
}

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

.toggle-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.wide-form {
    max-width: 980px;
}

.compact-form {
    box-shadow: none;
    padding: 0;
}

.nested-panel {
    box-shadow: none;
    display: grid;
    gap: 14px;
    margin: 8px 0;
}

.field-list {
    display: grid;
    gap: 16px;
}

.field-row {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: grid;
    gap: 12px;
    padding: 16px;
}

.prompt-layout {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.prompt-editor textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prompt-side {
    position: sticky;
    top: 24px;
}

.variable-list,
.version-list {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.variable-list button {
    background: #fff;
    border-color: var(--line);
    color: var(--primary);
    justify-content: flex-start;
    min-height: 34px;
}

.version-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr auto auto;
    padding-bottom: 10px;
}

.sample-values h2 {
    font-size: 18px;
    margin: 8px 0 0;
}

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

pre {
    background: #f1f4f2;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    overflow-x: auto;
    padding: 14px;
    white-space: pre-wrap;
}

.prompt-meta-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.prompt-meta-grid div {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 12px;
}

.prompt-meta-grid strong,
.prompt-meta-grid span {
    display: block;
}

.prompt-meta-grid span {
    color: var(--muted);
    margin-top: 4px;
}

.delete-form {
    justify-self: start;
}

.submission-detail {
    display: grid;
    gap: 10px 18px;
    grid-template-columns: 180px minmax(0, 1fr);
    margin: 0;
}

.submission-detail dt {
    color: var(--muted);
    font-weight: 800;
}

.submission-detail dd {
    margin: 0;
    word-break: break-word;
}

.row-actions form,
.inline-form {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.row-actions button,
.delete-form button {
    background: #fff;
    border-color: #e0b6b6;
    color: var(--danger);
    min-height: 34px;
    padding: 6px 10px;
}

.inline-form input {
    max-width: 100px;
}

.logout-form button {
    background: transparent;
    border: 0;
    color: var(--primary);
    min-height: auto;
    padding: 0;
}

.logout-form button:hover {
    background: transparent;
    color: var(--primary-dark);
}

@media (max-width: 900px) {
    .topbar,
    .tool-header,
    .category-hero,
    .result-head,
    .dashboard-head,
    .admin-title,
    .admin-page-header,
    .form-section-head,
    .table-toolbar,
    .admin-summary-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-search {
        flex: none;
        width: 100%;
    }

    .result-meta {
        justify-content: flex-start;
    }

    .hero,
    .tool-layout,
    .admin-grid,
    .prompt-layout,
    .preview-grid,
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .prompt-side {
        position: static;
    }

    .sidebar {
        position: static;
    }

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

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

    .stack-actions {
        min-width: 0;
        width: 100%;
    }

    .admin-detail-list div {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .page,
    .admin-main,
    .hero,
    .home-hero,
    .category-hero,
    .tool-content,
    .run-box,
    .result-panel,
    .panel,
    .auth-box,
    .admin-card {
        padding: 18px;
    }

    .topbar {
        padding: 14px 18px;
    }

    .nav {
        flex-wrap: wrap;
    }

    .hero-search {
        grid-template-columns: 1fr;
    }

    .hero-search .button {
        width: 100%;
    }

    .tool-actions,
    .tool-actions .inline-form,
    .tool-actions .button {
        width: 100%;
    }
}
