@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap");

:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #eef3f8;
    --text: #172033;
    --muted: #667085;
    --border: #d8e0ea;
    --primary: #0f766e;
    --primary-strong: #0b5f59;
    --primary-soft: #dff7f4;
    --shadow: 0 14px 32px rgba(20, 31, 50, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.10), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(216, 224, 234, 0.86);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(1120px, calc(100% - 2rem));
    min-height: 72px;
    margin: 0 auto;
}

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

.brand-logo {
    display: block;
    flex: 0 0 auto;
    width: auto;
    height: 44px;
    max-width: 148px;
    object-fit: contain;
}

.brand-text {
    min-width: 0;
}

.brand-name {
    display: block;
    overflow: hidden;
    font-size: 1.02rem;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-subtitle {
    display: block;
    margin-top: 0.1rem;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.25;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0 0.75rem;
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.credits-badge [class^="icon-"] {
    font-size: 1rem;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 6px 18px rgba(20, 31, 50, 0.06);
}

.language-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: var(--muted);
    font-size: 1.05rem;
}

.language-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2rem;
    padding: 0 0.7rem;
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.language-link:hover,
.language-link:focus-visible {
    background: var(--surface-soft);
    color: var(--text);
    outline: none;
}

.language-link.active {
    background: var(--primary-soft);
    color: var(--primary-strong);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.16);
}

.header-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0 0.7rem;
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.header-tab:hover,
.header-tab:focus-visible,
.header-tab.active {
    background: var(--primary-soft);
    color: var(--primary-strong);
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.16);
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0 0.7rem;
    gap: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.logout-button:hover,
.logout-button:focus-visible {
    background: var(--surface-soft);
    color: var(--text);
    outline: none;
}

.logout-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.page {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3rem 0;
}

.content-panel {
    max-width: 620px;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.dashboard-panel {
    max-width: none;
}

.dashboard-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 2rem;
    align-items: start;
}

.setup-panel {
    align-content: start;
}

.automation-button {
    flex: 0 0 auto;
}

.automation-output {
    min-width: 0;
    height: var(--automation-output-height, min(980px, calc(100vh - 160px)));
    max-height: var(--automation-output-height, min(980px, calc(100vh - 160px)));
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 0.35rem;
}

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

.output-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    line-height: 1.3;
}

.output-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.output-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.output-header-actions .secondary-button {
    min-height: 2rem;
    padding: 0 0.65rem;
    font-size: 0.78rem;
}

.page-count {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0 0.65rem;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

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

.page-slot {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfe;
    place-items: center;
    text-align: center;
    overflow: hidden;
}

.page-slot.is-running {
    border-color: rgba(15, 118, 110, 0.38);
    background: #f2fbfa;
}

.page-slot img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-number {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    z-index: 1;
    display: inline-grid;
    min-width: 1.65rem;
    max-width: calc(100% - 5.2rem);
    min-height: 1.65rem;
    padding: 0 0.45rem;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.page-placeholder {
    position: relative;
    z-index: 1;
    color: #9aa8b8;
    font-size: 1.65rem;
}

.page-slot.has-image .page-placeholder {
    display: none;
}

.page-reuse-controls {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    left: 0.55rem;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.4rem;
    align-items: center;
}

.skip-toggle {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    min-height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid rgba(216, 224, 234, 0.88);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.skip-toggle input {
    width: 0.9rem;
    height: 0.9rem;
    margin: 0 0.35rem 0 0;
    accent-color: var(--primary);
}

.page-reuse-controls select {
    width: 100%;
    min-width: 0;
    height: 2rem;
    padding: 0 0.45rem;
    border: 1px solid rgba(216, 224, 234, 0.88);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 700;
}

.page-reuse-controls select:disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.72;
}

.reroll-button {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid rgba(216, 224, 234, 0.88);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-strong);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-0.2rem);
    transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.download-button {
    position: absolute;
    top: 0.55rem;
    right: 3rem;
    z-index: 2;
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid rgba(216, 224, 234, 0.88);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-strong);
    text-decoration: none;
    opacity: 0;
    transform: translateY(-0.2rem);
    transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.page-slot:hover .download-button,
.page-slot:focus-within .download-button,
.page-slot.has-image .download-button {
    opacity: 1;
    transform: translateY(0);
}

.download-button:hover,
.download-button:focus-visible {
    background: var(--primary-soft);
    outline: none;
}

.page-slot:hover .reroll-button,
.page-slot:focus-within .reroll-button,
.page-slot.has-image .reroll-button {
    opacity: 1;
    transform: translateY(0);
}

.reroll-button:hover,
.reroll-button:focus-visible {
    background: var(--primary-soft);
    outline: none;
}

.reroll-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.reroll-button:disabled span {
    animation: spin 900ms linear infinite;
}

.page-status {
    position: relative;
    z-index: 1;
    margin-bottom: 2.25rem;
    padding: 0.25rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    align-self: end;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-page {
    display: grid;
    place-items: start center;
}

.auth-panel {
    width: min(100%, 480px);
}

.auth-heading {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-icon {
    display: grid;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 1.3rem;
}

h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.08;
}

.lead {
    margin: 0 0 1.5rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

input {
    width: 100%;
    max-width: 380px;
    height: 44px;
    padding: 0 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    outline: none;
}

select {
    width: 100%;
    max-width: 380px;
    height: 44px;
    padding: 0 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

textarea {
    width: 100%;
    min-height: 176px;
    resize: vertical;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    outline: none;
}

.form-grid {
    display: grid;
    gap: 1.25rem;
}

.field {
    display: grid;
    gap: 0.45rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
}

.field input {
    max-width: none;
}

.field select {
    max-width: none;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    min-width: 128px;
    min-height: 44px;
    padding: 0 1rem;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary-button:hover,
.primary-button:focus-visible {
    background: var(--primary-strong);
    outline: none;
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    min-height: 40px;
    padding: 0 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button:hover,
.secondary-button:focus-visible {
    border-color: rgba(15, 118, 110, 0.34);
    background: #f2fbfa;
    color: var(--primary-strong);
    outline: none;
}

.secondary-button.is-static {
    border-color: rgba(15, 118, 110, 0.22);
    background: var(--primary-soft);
    color: var(--primary-strong);
    cursor: default;
}

.secondary-button.is-static:hover,
.secondary-button.is-static:focus-visible {
    border-color: rgba(15, 118, 110, 0.22);
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.secondary-button.compact {
    min-height: 36px;
    padding: 0 0.65rem;
    font-size: 0.82rem;
}

.form-message {
    min-height: 1.4rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.form-message.success {
    color: var(--primary-strong);
}

.form-message.error {
    color: #b42318;
}

.photo-upload {
    width: min(100%, 460px);
}

.photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.photo-dropzone {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 124px;
    padding: 1.1rem;
    border: 1.5px dashed #a8b6c7;
    border-radius: 8px;
    background: #fbfcfe;
    color: var(--text);
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.photo-dropzone:hover,
.photo-input:focus-visible + .photo-dropzone,
.photo-upload.drag-over .photo-dropzone {
    border-color: var(--primary);
    background: #f2fbfa;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.10);
}

.photo-icon {
    display: grid;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 1.45rem;
}

.photo-text {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.photo-title {
    font-weight: 750;
    line-height: 1.25;
}

.photo-hint {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.photo-preview {
    position: relative;
    overflow: hidden;
    margin-top: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.photo-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.photo-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.photo-preview-actions span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-remove {
    display: inline-grid;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    cursor: pointer;
}

.photo-remove:hover,
.photo-remove:focus-visible {
    border-color: #f0a5a5;
    color: #b42318;
    outline: none;
}

.prompt-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, 460px);
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfe;
}

.prompt-summary-title,
.prompt-summary-status {
    display: block;
}

.prompt-summary-title {
    font-weight: 800;
    line-height: 1.25;
}

.prompt-summary-status {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.prompt-summary-status.error {
    color: #b42318;
}

.prompt-summary-status.success {
    color: var(--primary-strong);
}

.template-summary {
    display: grid;
    gap: 0.85rem;
    width: min(100%, 460px);
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfe;
}

.template-save,
.template-load {
    display: grid;
    gap: 0.65rem;
}

.template-save {
    grid-template-columns: minmax(0, 1fr) auto;
}

.template-save input,
.template-load select {
    max-width: none;
}

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

.template-actions .secondary-button,
.template-save .secondary-button {
    width: 100%;
    min-width: 0;
    white-space: normal;
}

.canva-progress {
    overflow: hidden;
    width: min(100%, 260px);
    height: 0.5rem;
    margin-top: 0.65rem;
    border-radius: 999px;
    background: #e6edf5;
}

.canva-progress-bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 500ms ease;
}

.canva-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.prompts-panel {
    max-width: none;
}

.generations-panel {
    max-width: none;
}

.accounts-panel {
    max-width: none;
}

.account-create-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.9rem;
    align-items: end;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.account-create-form .primary-button {
    width: 100%;
}

.account-template-list {
    display: grid;
    gap: 0.35rem;
    min-height: 112px;
    max-height: 160px;
    overflow-y: auto;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.account-template-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 32px;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.account-template-option:hover {
    background: #f3f7fb;
}

.account-template-option input {
    width: 1rem;
    height: 1rem;
    max-width: none;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.account-template-empty {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.account-create-form .form-message {
    grid-column: 1 / -1;
    margin: 0;
}

.accounts-status {
    margin-bottom: 0.9rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.accounts-status.error {
    color: #b42318;
}

.accounts-status.success {
    color: var(--primary-strong);
}

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

.accounts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

.accounts-table th {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.accounts-table input {
    width: 6.5rem;
    min-height: 2rem;
    padding: 0 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.account-action-button {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.account-action-button.danger {
    color: #b42318;
}

.account-action-button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

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

.prompt-form {
    display: grid;
    gap: 1.25rem;
}

.token-help {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.45;
}

.token-help [class^="icon-"] {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

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

.prompt-card {
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfe;
}

.prompt-card-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 800;
}

.prompt-number {
    display: inline-grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 0.78rem;
}

.prompt-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.history-status {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfe;
    color: var(--muted);
    font-weight: 700;
}

.history-status.error {
    color: #b42318;
}

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

.history-item {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfe;
}

.history-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.history-meta {
    display: grid;
    gap: 0.55rem;
    padding: 0.85rem;
}

.history-meta strong {
    font-size: 0.96rem;
}

.history-meta span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

@media (max-width: 560px) {
    .header-inner {
        width: min(100% - 1rem, 1120px);
        min-height: 64px;
        gap: 0.65rem;
    }

    .brand-logo {
        height: 38px;
        max-width: 112px;
    }

    .brand-subtitle {
        display: none;
    }

    .language-icon {
        display: none;
    }

    .credits-badge {
        min-height: 34px;
        padding: 0 0.55rem;
        font-size: 0.76rem;
    }

    .language-link {
        min-width: 2.4rem;
        padding: 0 0.55rem;
    }

    .page {
        width: min(100% - 1rem, 1120px);
        padding-top: 1.5rem;
    }

    .content-panel {
        padding: 1.25rem;
    }

    .dashboard-intro {
        display: grid;
        gap: 1rem;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .automation-button {
        width: 100%;
    }

    .prompt-summary,
    .prompt-summary .secondary-button {
        width: 100%;
    }

    .prompt-summary,
    .page-toolbar,
    .prompt-actions,
    .token-help {
        display: grid;
    }

    .output-header {
        display: grid;
    }

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

    .page-slot {
        min-height: 0;
    }

    .photo-dropzone {
        align-items: flex-start;
        min-height: 112px;
        padding: 0.9rem;
    }

    .prompt-list {
        grid-template-columns: 1fr;
    }

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