:root {
    --bg: #eef3f1;
    --panel: #ffffff;
    --panel-2: #f6f8f7;
    --line: #d6e1dc;
    --text: #17312a;
    --muted: #5b7269;
    --accent: #1f7a5c;
    --accent-strong: #155943;
    --danger: #b2442e;
    --danger-soft: #fff0ec;
    --ok: #e9f6ef;
    --ok-line: #b6dec7;
    --error: #fff2f0;
    --error-line: #e9b8ae;
    --shadow: 0 18px 40px rgba(23, 49, 42, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(31, 122, 92, 0.08), transparent 34%),
        linear-gradient(180deg, #f6faf8 0%, var(--bg) 100%);
    color: var(--text);
}

body {
    min-height: 100vh;
}

a {
    color: var(--accent-strong);
}

.shell {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.site-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.site-header h1 {
    margin: 4px 0 10px;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1;
    letter-spacing: 0.04em;
}

.eyebrow {
    margin: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
}

.subtitle {
    margin: 0;
    max-width: 36rem;
    color: var(--muted);
}

.session-bar {
    min-width: 240px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
}

.session-bar p {
    margin: 0 0 14px;
    word-break: break-word;
}

.flash,
.panel,
.intro-card,
.auth-card,
.slot-card {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.flash {
    padding: 14px 16px;
    margin-bottom: 20px;
}

.flash-success {
    background: var(--ok);
    border-color: var(--ok-line);
}

.flash-error {
    background: var(--error);
    border-color: var(--error-line);
}

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

.auth-card {
    width: min(520px, 100%);
    padding: 28px;
}

.auth-card h2,
.intro-card h2 {
    margin-top: 0;
}

.muted {
    color: var(--muted);
}

.stack-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.stack-form label,
.file-input {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-2);
    color: var(--text);
    font: inherit;
}

input[type="file"] {
    padding: 10px;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease;
}

.button:hover {
    transform: translateY(-1px);
    background: var(--accent-strong);
}

.button-ghost,
.button-secondary {
    background: #e2eee9;
    color: var(--text);
}

.button-ghost:hover,
.button-secondary:hover {
    background: #d3e5dd;
}

.button-danger {
    background: var(--danger);
}

.button-danger:hover {
    background: #943621;
}

.panel {
    padding: 14px 16px;
}

.panel-error {
    background: var(--danger-soft);
    border-color: #e6b7ab;
}

.panel p {
    margin: 0;
}

.panel p + p {
    margin-top: 8px;
}

.auth-links {
    margin-bottom: 0;
    margin-top: 18px;
}

.intro-card {
    padding: 22px 24px;
    margin-bottom: 20px;
}

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

.slot-card {
    padding: 20px;
}

.slot-card-empty {
    background: rgba(255, 255, 255, 0.92);
}

.slot-card-filled {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
}

.slot-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.slot-head h3 {
    margin: 0;
    font-size: 1.12rem;
}

.slot-badge {
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    background: #e5efe9;
    color: var(--accent-strong);
}

.slot-body,
.slot-body-filled {
    display: grid;
    gap: 16px;
}

.upload-form {
    display: grid;
    gap: 14px;
    align-items: end;
}

.meta-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.meta-list div {
    display: grid;
    gap: 6px;
}

.meta-list dt {
    font-size: 0.86rem;
    color: var(--muted);
}

.meta-list dd {
    margin: 0;
    word-break: break-all;
}

.url-input {
    background: #edf3f0;
}

.qr-block {
    display: flex;
    justify-content: flex-start;
}

.qr-code {
    display: inline-grid;
    place-items: center;
    min-width: 196px;
    min-height: 196px;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: #fff;
}

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

.delete-form {
    margin: 0;
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 20px, 100%);
        padding-top: 18px;
    }

    .site-header {
        flex-direction: column;
    }

    .session-bar {
        width: 100%;
    }

    .auth-card,
    .intro-card,
    .slot-card {
        padding: 18px;
    }

    .action-row {
        flex-direction: column;
    }

    .action-row .button,
    .delete-form .button,
    .upload-form .button {
        width: 100%;
    }

    .qr-code {
        min-width: 168px;
        min-height: 168px;
    }
}
