:root {
    --bg: #eef3ef;
    --bg-2: #dfe9e3;
    --ink: #1c2a24;
    --muted: #4d5f56;
    --brand: #1f4d3a;
    --brand-soft: #2f6b52;
    --accent: #c45c26;
    --accent-hover: #a64b1d;
    --surface: #ffffff;
    --line: #c5d2ca;
    --ok: #1f6b4a;
    --shadow: 0 10px 30px rgba(28, 42, 36, 0.08);
    --radius: 18px;
    --font-display: "Shippori Mincho", "Hiragino Mincho ProN", serif;
    --font-body: "Zen Maru Gothic", "Hiragino Sans", sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 20px; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(47, 107, 82, 0.12), transparent 40%),
        radial-gradient(circle at bottom right, rgba(196, 92, 38, 0.10), transparent 35%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    min-height: 100vh;
    line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
    width: min(920px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    padding: 0.75rem 0;
    margin-bottom: 0.6rem;
    border-bottom: 2px solid rgba(197, 210, 202, 0.85);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    flex-wrap: nowrap;
}

.brand {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: 0.06em;
    line-height: 1.15;
    flex: 0 0 auto;
    max-width: 11rem;
}

.brand span {
    display: block;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.04em;
    margin-top: 0.1rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
}

.nav-main a {
    font-size: 1rem;
    font-weight: 700;
    padding: 0.55rem 0.7rem;
    min-height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.nav-main a:hover {
    background: rgba(31, 77, 58, 0.08);
    color: var(--brand);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    margin-left: auto;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.auth-links form {
    margin: 0;
}

.nav-link-ghost,
.nav-link-solid,
.nav-btn {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    min-height: 2.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    border: 2px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    color: var(--ink);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.nav-link-ghost:hover,
.nav-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.nav-link-solid {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.nav-link-solid:hover {
    background: var(--brand-soft);
    border-color: var(--brand-soft);
    color: #fff;
}

.lang-select-wrap {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.lang-select {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    min-height: 2.5rem;
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    border-radius: 12px;
    border: 2px solid var(--line);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231f4d3a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
    background-size: 12px 8px;
    color: var(--ink);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    min-width: 8.5rem;
}

.lang-select:focus {
    outline: 3px solid rgba(31, 77, 58, 0.25);
    border-color: var(--brand);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.simple-top {
    padding-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 860px) {
    .header-inner {
        flex-wrap: wrap;
        row-gap: 0.55rem;
    }

    .brand {
        max-width: none;
    }

    .nav-main {
        order: 3;
        width: 100%;
        justify-content: stretch;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.35rem;
    }

    .nav-main a {
        background: #fff;
        border-color: var(--line);
        font-size: 0.95rem;
        padding: 0.65rem 0.3rem;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
    }

    .header-actions {
        margin-left: auto;
    }
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    min-height: 72vh;
    display: grid;
    align-items: end;
    background:
        linear-gradient(180deg, rgba(20, 45, 35, 0.15), rgba(20, 45, 35, 0.78)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='%23ffffff' fill-opacity='0.05' d='M0 80h160M80 0v160'/%3E%3C/svg%3E"),
        linear-gradient(135deg, #2f6b52, #1c3d31 45%, #7a4a2a);
    color: #fff;
    margin: 0.5rem 0 2rem;
    animation: fade-up 0.8s ease both;
}

.hero-inner {
    padding: 2.4rem 1.6rem 2.2rem;
    width: min(640px, 100%);
}

.hero .brand-hero {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 8vw, 4.2rem);
    line-height: 1.1;
    margin: 0 0 0.4rem;
}

.brand-meanings {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 3.5vw, 1.45rem);
    letter-spacing: 0.35em;
    margin: 0 0 1rem !important;
    opacity: 0.92;
}

.hero p {
    font-size: 1.15rem;
    margin: 0 0 1.4rem;
    max-width: 28ch;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.4rem;
    padding: 0.85rem 1.4rem;
    border-radius: 14px;
    border: 3px solid transparent;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: #fff;
    color: var(--brand);
    border-color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--brand);
    border-color: var(--brand);
}

.btn-block {
    width: 100%;
}

.panel {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.2rem;
    animation: fade-up 0.6s ease both;
}

.panel h1,
.panel h2 {
    font-family: var(--font-display);
    margin: 0 0 0.7rem;
    line-height: 1.35;
}

.panel h1 { font-size: 1.7rem; }
.panel h2 { font-size: 1.35rem; }

.lead {
    font-size: 1.1rem;
    color: var(--muted);
    margin: 0 0 1rem;
}

.flash {
    background: #e7f5ee;
    border: 2px solid #9ecfb8;
    color: var(--ok);
    padding: 1rem 1.1rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.todo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.7rem;
}

.todo-list a {
    display: block;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: #f4f8f5;
    border: 2px solid var(--line);
    font-size: 1.15rem;
    font-weight: 700;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

@media (min-width: 640px) {
    .menu-grid { grid-template-columns: 1fr 1fr; }
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 5.2rem;
    padding: 1.1rem;
    border-radius: 18px;
    background: var(--brand);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, background 0.15s ease;
    white-space: pre-line;
}

.menu-btn:hover { background: var(--brand-soft); }
.menu-btn:active { transform: scale(0.98); }

.role-grid {
    display: grid;
    gap: 0.9rem;
}

.role-card {
    display: block;
    padding: 1.2rem;
    border-radius: 16px;
    border: 3px solid var(--line);
    background: #fff;
}

.role-card strong {
    display: block;
    font-size: 1.35rem;
    margin-bottom: 0.3rem;
}

.role-card span {
    color: var(--muted);
    font-size: 1.05rem;
}

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.tab {
    min-height: 3.2rem;
    border-radius: 12px;
    border: 3px solid var(--line);
    background: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chip {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.chip.active {
    background: #1f4d3a;
    color: #fff;
    border-color: #1f4d3a;
}

.card-list {
    display: grid;
    gap: 0.85rem;
}

.item-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 0.9rem;
    padding: 0.9rem;
    border: 2px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.thumb {
    width: 88px;
    height: 88px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    padding: 0.4rem;
}

.item-card h3 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}

.meta {
    color: var(--muted);
    font-size: 0.95rem;
}

.tag {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #f3e6dc;
    color: #8a3d14;
    font-size: 0.85rem;
    font-weight: 700;
}

.work-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 700px) {
    .work-grid { grid-template-columns: 1fr 1fr; }
}

.work-card {
    border: 2px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.work-visual {
    height: 180px;
    display: flex;
    align-items: end;
    padding: 1rem;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.4rem;
}

.work-body { padding: 1rem; }

.form-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.field,
.textarea {
    width: 100%;
    border: 3px solid var(--line);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    font-size: 1.15rem;
    background: #fff;
    color: var(--ink);
    margin-bottom: 1rem;
}

.textarea { min-height: 8rem; resize: vertical; }

.choice-grid {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.choice {
    display: block;
}

.choice input { display: none; }

.choice span {
    display: block;
    padding: 1rem;
    border: 3px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font-size: 1.15rem;
    font-weight: 700;
}

.choice input:checked + span {
    border-color: var(--brand);
    background: #e8f3ec;
}

.chat {
    display: grid;
    gap: 0.7rem;
}

.bubble {
    max-width: 90%;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    font-size: 1.1rem;
}

.bubble.them {
    background: #eef4f0;
    border: 2px solid var(--line);
    justify-self: start;
}

.bubble.me {
    background: var(--brand);
    color: #fff;
    justify-self: end;
}

.bubble .who {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 0.2rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand);
}

.site-footer {
    padding: 2rem 0 2.5rem;
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}

.demo-note {
    font-size: 0.95rem;
    color: var(--muted);
    margin-top: 0.8rem;
}

.demo-note a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: underline;
}

.error-box {
    background: #fdecea;
    border: 2px solid #e2a39a;
    color: #8a2f24;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.error-box p { margin: 0.2rem 0; }

.check-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1.1rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.check-row input {
    width: 1.3rem;
    height: 1.3rem;
}

.demo-accounts {
    margin-top: 1.4rem;
    padding: 1rem;
    border-radius: 14px;
    background: #f4f8f5;
    border: 2px solid var(--line);
    font-size: 0.98rem;
}

.demo-accounts p { margin: 0.25rem 0; }

.lang-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0 0.8rem;
}

.lang-bar .lang-btn,
.lang-label + .lang-btn {
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.5rem 0.9rem;
    min-height: 2.5rem;
    border-radius: 12px;
    border: 2px solid var(--line);
    background: #fff;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
}

.lang-bar .lang-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.lang-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    margin-right: 0.2rem;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
