/* ═══════════════════════════════════════════
   CARD NEWS GENERATOR — Design System
   Based on DESIGN_GUIDE.md (SIMPLE STORAGE)
   ═══════════════════════════════════════════ */

@font-face {
    font-family: 'Vitro Core';
    src: url('./VITRO CORE TTF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Backgrounds */
    --bg-white: #FFFFFF;
    --bg-light: #F7F8FA;
    --bg-hero: #50C878;
    --bg-hero-end: #3EAD62;

    /* Borders */
    --border: #F0F2F5;
    --border-mid: #E5E8EB;

    /* Accent (Deep Forest Green) */
    --green: #34854F;
    --green-hover: #2A6E42;
    --blue: #3D9A5C;
    --blue-hover: #34854F;

    /* Danger */
    --red: #FF4757;
    --red-hover: #FF6B81;

    /* Text */
    --text-primary: #1A1E27;
    --text-secondary: #555961;
    --text-tertiary: #888D96;
    --text-light: #B4B8BF;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    /* Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
    background: var(--bg-white);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ═══════════════ KEYFRAMES ═══════════════ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(120%); opacity: 0; }
}

@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -10px); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ═══════════════ HERO ═══════════════ */

.hero {
    background: linear-gradient(135deg, var(--bg-hero) 0%, var(--bg-hero-end) 100%);
    padding: 64px 24px 56px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-decoration {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero-deco-1 {
    width: 500px;
    height: 500px;
    top: -200px;
    left: -150px;
    background: radial-gradient(circle, rgba(52, 133, 79, 0.15) 0%, transparent 70%);
    animation: heroFloat 8s ease-in-out infinite;
}

.hero-deco-2 {
    width: 400px;
    height: 400px;
    bottom: -150px;
    right: -100px;
    background: radial-gradient(circle, rgba(52, 133, 79, 0.12) 0%, transparent 70%);
    animation: heroFloat 10s ease-in-out infinite reverse;
}

.hero-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Vitro Core', sans-serif;
    font-style: italic;
    font-size: 56px;
    font-weight: 400;
    color: #FFFFFF;
    letter-spacing: 3px;
    line-height: 1.15;
    margin-bottom: 12px;
    animation: fadeInUp 0.8s ease both;
}

.hero-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
    letter-spacing: 0.5px;
    margin-bottom: 36px;
    animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-dropzone {
    border: 2px dashed rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 28px 32px;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeInUp 0.8s ease 0.2s both;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hero-dropzone:hover,
.hero-dropzone.dragover {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.04);
}

.hero-dropzone.dragover {
    border-color: var(--blue);
    background: rgba(52, 133, 79, 0.08);
}

.dropzone-default,
.dropzone-uploaded {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    display: none;
}

.dropzone-default:not([hidden]),
.dropzone-uploaded:not([hidden]) {
    display: flex;
}

.dropzone-text {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 400;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: var(--green);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius);
    font-size: 17px;
    font-family: 'Vitro Core', sans-serif;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(52, 133, 79, 0.35);
}

.btn-cta:hover {
    background: var(--green-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 133, 79, 0.45);
}

.hero-file-info {
    margin-top: 20px;
    animation: fadeInUp 0.4s ease both;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50px;
    padding: 8px 16px 8px 12px;
    color: #fff;
    font-size: 13px;
}

.file-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.file-icon.pdf { background: var(--red); }
.file-icon.txt { background: var(--text-tertiary); }

.file-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-remove {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.file-remove:hover { background: var(--red); }

/* ═══════════════ TAB NAV ═══════════════ */

.tab-nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    position: relative;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    font-family: inherit;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active { color: var(--green); }

.tab-num {
    font-family: 'Vitro Core', sans-serif;
    font-style: italic;
    font-size: 13px;
    opacity: 0.5;
}

.tab-btn.active .tab-num { opacity: 1; }

.tab-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--green);
    transition: left 0.3s ease, width 0.3s ease;
    border-radius: 2px 2px 0 0;
}

/* ═══════════════ MAIN LAYOUT ═══════════════ */

.main-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: flex;
    gap: 28px;
    min-height: 60vh;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.content {
    flex: 1;
    min-width: 0;
}

/* ═══════════════ SIDEBAR CARDS ═══════════════ */

.sidebar-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 20px;
    animation: fadeInUp 0.5s ease both;
}

.sidebar-card:nth-child(2) { animation-delay: 0.05s; }
.sidebar-card:nth-child(3) { animation-delay: 0.1s; }
.sidebar-card:nth-child(4) { animation-delay: 0.15s; }

.sidebar-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.sidebar-card-title svg {
    color: var(--blue);
    flex-shrink: 0;
}

/* Stats */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-mid);
}

.stat-row:last-child { border-bottom: none; }

.stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
}

.stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Queue */
.queue-list {
    max-height: 200px;
    overflow-y: auto;
}

.queue-empty {
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
    padding: 16px 0;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.queue-item:last-child { border-bottom: none; }

.queue-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.queue-dot.pending { background: var(--text-light); }
.queue-dot.processing { background: var(--blue); animation: pulse 1.5s infinite; }
.queue-dot.completed { background: #22C55E; }
.queue-dot.error { background: var(--red); }

.queue-item-label {
    flex: 1;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Log */
.log-card { max-height: 320px; }

.log-box {
    max-height: 200px;
    overflow-y: auto;
    font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 11px;
    line-height: 1.7;
    color: var(--text-tertiary);
    padding: 12px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.log-box::-webkit-scrollbar { width: 4px; }
.log-box::-webkit-scrollbar-track { background: transparent; }
.log-box::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; }

.log-empty {
    color: var(--text-light);
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
    font-family: inherit;
}

.log-entry { padding: 1px 0; }
.log-entry .log-time { color: var(--blue); }

/* ═══════════════ FORMS ═══════════════ */

.form-group { margin-bottom: 12px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-xs);
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(52, 133, 79, 0.1);
}

.form-input::placeholder { color: var(--text-light); }

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.input-with-btn {
    display: flex;
    gap: 6px;
}

.input-with-btn .form-input { flex: 1; }

/* ═══════════════ BUTTONS ═══════════════ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--green);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--green-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 133, 79, 0.25);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-xs);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-ghost:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    border-color: var(--border-mid);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-danger:hover {
    background: var(--red);
    color: #fff;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-xs);
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.btn-icon.active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--blue);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--blue-hover);
    transform: translateY(-1px);
}

/* ═══════════════ CARDS ═══════════════ */

.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    animation: fadeInUp 0.5s ease both;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* ═══════════════ SECTIONS ═══════════════ */

.section-header {
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease both;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.section-desc {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ═══════════════ EMPTY STATES ═══════════════ */

.empty-state {
    text-align: center;
    padding: 60px 24px;
    animation: fadeIn 0.5s ease;
}

.empty-icon {
    margin-bottom: 20px;
    opacity: 0.4;
}

.empty-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 13px;
    color: var(--text-light);
}

/* ═══════════════ TAB PANELS ═══════════════ */

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ═══════════════ STEP 1: PLAN ═══════════════ */

.option-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.radio-group {
    display: flex;
    gap: 12px;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input { position: absolute; opacity: 0; pointer-events: none; }

.radio-card-body {
    padding: 16px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    text-align: center;
}

.radio-card input:checked + .radio-card-body {
    border-color: var(--green);
    background: rgba(52, 133, 79, 0.04);
}

.radio-card:hover .radio-card-body {
    border-color: var(--border-mid);
}

.radio-card-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.radio-card-desc {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Plan Display */
.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.plan-actions {
    display: flex;
    gap: 8px;
}

.plan-section {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    position: relative;
    animation: fadeInUp 0.4s ease both;
}

.plan-section:nth-child(2) { animation-delay: 0.05s; }
.plan-section:nth-child(3) { animation-delay: 0.1s; }

.plan-section-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.plan-section-tag.tag-body { background: var(--blue); }
.plan-section-tag.tag-outro { background: var(--text-tertiary); }

.plan-main-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.plan-sub-title {
    font-size: 14px;
    color: var(--text-tertiary);
}

.plan-body-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Plan Edit */
.plan-edit-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.plan-edit-section:last-of-type { border-bottom: none; }

.plan-edit-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.plan-edit-section-header .form-label { margin-bottom: 0; }

.body-page-edit {
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    position: relative;
}

.body-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.body-page-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-remove-page {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-remove-page:hover { background: rgba(255, 71, 87, 0.1); }

.plan-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* ═══════════════ STEP 2: DESIGN ═══════════════ */

.ratio-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.ratio-card {
    flex: 1;
    cursor: pointer;
    text-align: center;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    position: relative;
}

.ratio-card input { position: absolute; opacity: 0; pointer-events: none; }

.ratio-card.active,
.ratio-card:has(input:checked) {
    border-color: var(--green);
    background: rgba(52, 133, 79, 0.03);
}

.ratio-card:hover { border-color: var(--border-mid); }

.ratio-preview {
    width: 48px;
    margin: 0 auto 10px;
    background: var(--bg-light);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
}

.ratio-4-5 { height: 60px; }
.ratio-1-1 { height: 48px; }
.ratio-9-16 { height: 85px; width: 48px; }

.ratio-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.ratio-desc {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Concept Grid */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.concept-card {
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.concept-card:hover {
    border-color: var(--border-mid);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.concept-card.selected {
    border-color: var(--green);
    background: rgba(52, 133, 79, 0.03);
}

.concept-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.concept-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* Progress */
.progress-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--green));
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

/* Design page items */
.design-page-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: all 0.2s;
}

.design-page-item:hover { background: var(--bg-light); }

.design-page-thumb {
    width: 64px;
    height: 80px;
    background: var(--bg-light);
    border-radius: var(--radius-xs);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-page-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.design-page-thumb .thumb-placeholder {
    color: var(--text-light);
    font-size: 11px;
}

.design-page-info {
    flex: 1;
    min-width: 0;
}

.design-page-type {
    font-size: 10px;
    font-weight: 700;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.design-page-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.design-page-status {
    font-size: 12px;
    color: var(--text-tertiary);
}

.design-page-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ═══════════════ GALLERY ═══════════════ */

.gallery-view-toggle {
    display: flex;
    gap: 4px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.gallery-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gallery-item-img {
    width: 100%;
    aspect-ratio: 4/5;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-info {
    padding: 12px 16px;
}

.gallery-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-item-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.gallery-item-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-actions { opacity: 1; }

.gallery-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.gallery-action-btn:hover {
    background: var(--green);
    color: #fff;
}

/* Gallery list view */
.gallery-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-grid.list-view .gallery-item {
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
}

.gallery-grid.list-view .gallery-item-img {
    width: 64px;
    height: 64px;
    aspect-ratio: auto;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    margin: 8px;
}

.gallery-grid.list-view .gallery-item-info {
    flex: 1;
}

.gallery-grid.list-view .gallery-item-actions {
    position: static;
    opacity: 1;
    padding-right: 12px;
}

/* ═══════════════ SKELETON ═══════════════ */

.skeleton-block {
    background: linear-gradient(90deg, #F0F2F5 25%, #E5E8EB 50%, #F0F2F5 75%);
    background-size: 400px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ═══════════════ TOAST ═══════════════ */

#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.4s ease both;
    pointer-events: auto;
    border-left: 4px solid var(--blue);
}

.toast.toast-exit { animation: slideOutRight 0.3s ease both; }

.toast.success { border-left-color: #22C55E; }
.toast.error { border-left-color: var(--red); }
.toast.info { border-left-color: var(--blue); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast.success .toast-icon { color: #22C55E; }
.toast.error .toast-icon { color: var(--red); }
.toast.info .toast-icon { color: var(--blue); }

.toast-content { flex: 1; }

.toast-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 12px;
    color: var(--text-tertiary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 2px;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover { color: var(--text-primary); }

/* ═══════════════ MODAL ═══════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay:not([hidden]) {
    display: flex;
}

.modal-container {
    background: var(--bg-white);
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    width: 560px;
    overflow: hidden;
    animation: scaleIn 0.3s ease both;
    display: flex;
    flex-direction: column;
}

.modal-container.modal-lg { width: 800px; }
.modal-container.modal-sm { width: 400px; }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Modal image preview */
.modal-image-preview {
    width: 100%;
    border-radius: var(--radius-sm);
}

/* ═══════════════ REGENERATION DIALOG ═══════════════ */

.regen-dialog {
    padding: 4px 0;
}

.regen-dialog .form-label { margin-bottom: 8px; }

.regen-dialog textarea {
    margin-bottom: 16px;
}

.regen-actions {
    display: flex;
    gap: 10px;
}

/* ═══════════════ SPINNER ═══════════════ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-mid);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

/* ═══════════════ MOBILE SIDEBAR TOGGLE ═══════════════ */

.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 200;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(52, 133, 79, 0.4);
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
}

/* ═══════════════ RESPONSIVE ═══════════════ */

@media (max-width: 900px) {
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: var(--bg-white);
        z-index: 300;
        padding: 24px 16px;
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open { display: flex; }

    .sidebar-toggle { display: flex; }

    .hero-title { font-size: 36px; }

    .main-wrap { padding: 24px 16px 48px; }

    .radio-group { flex-direction: column; }

    .ratio-grid { flex-wrap: wrap; }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 40px 16px 32px;
    }

    .hero-title {
        font-size: 28px;
        letter-spacing: 1px;
    }

    .hero-subtitle { font-size: 13px; }

    .btn-cta { font-size: 14px; padding: 10px 20px; }

    .hero-dropzone { padding: 28px 20px; }

    .tab-btn { padding: 12px 14px; font-size: 13px; }

    .tab-num { display: none; }

    .main-wrap { padding: 16px 12px 32px; }

    .card { padding: 16px; }

    .section-title { font-size: 18px; }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    #toast-container {
        top: auto;
        bottom: 80px;
        right: 12px;
        left: 12px;
    }

    .toast { min-width: auto; width: 100%; }

    .concept-grid {
        grid-template-columns: 1fr;
    }
}


/* ═══════════════════════════════════════════
   LIGHTBOX (이미지 크게 보기)
   ═══════════════════════════════════════════ */

#lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#lightbox.active {
    opacity: 1;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.lightbox-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}

.lightbox-label {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

.lightbox-actions {
    display: flex;
    gap: 8px;
}

.lightbox-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}
