/* ── Required field badge (shared across all user forms) ──── */
.label-required {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

:root {
    --u-primary: #1f5eff;
    --u-primary-hover: #1d4ed8;
    --u-bg: #f3f4f6;
    --u-text: #0f172a;
    --u-text-sub: #64748b;
    --u-border: #e2e8f0;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--u-bg);
    color: var(--u-text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#layout-wrapper.user-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    flex: 1;
}

/* ── Container (max-w-7xl equivalent) ───────────── */
.user-container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 768px) {
    .user-container {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* ── Header ─────────────────────────────────────── */
.user-header {
    background: #fff;
    border-bottom: 1px solid var(--u-border);
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.user-brand-icon {
    color: #1f5eff;
    display: inline-flex;
    align-items: center;
}

.user-brand-text {
    font-size: 20px;
    font-weight: 500;
    color: #494645;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .user-brand-text {
        font-size: 24px;
    }
}

.user-brand {
    max-width: 181px;
}

@media (min-width: 768px) {
    .user-brand {
        max-width: 272px;
    }
}

.header-search-form {
    width: 280px;
}

.header-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search-icon {
    position: absolute;
    left: 8px;
    background: none;
    border: none;
    padding: 4px;
    font-size: 16px;
    color: var(--u-text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.header-search-icon:hover {
    color: var(--u-primary);
}

.header-search-input {
    width: 100%;
    border: 1px solid var(--u-border);
    border-radius: calc(.625rem - 2px);
    padding: 8px 32px 8px 36px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s, background .15s;
}

.header-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 2px;
    color: var(--u-text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    line-height: 1;
}

.header-search-clear:hover {
    color: var(--u-text);
}

.header-search-input:focus {
    border-color: var(--u-primary);
    background: #fff;
}

/* Logged-in: avatar pill */
.header-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border-radius: 9999px;
    border: 1px solid var(--u-border);
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: var(--u-text);
}

.header-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1f5eff;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.header-user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-header-login {
    background: var(--u-primary);
    color: #fff;
    border: 0;
    border-radius: 9999px;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(31,94,255,.3);
    transition: background .15s;
}

.btn-header-login:hover {
    background: var(--u-primary-hover);
    color: #fff;
}

.btn-header-logout {
    background: #fff;
    color: var(--u-text);
    border: 1px solid var(--u-border);
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.btn-header-logout:hover {
    background: #f8fafc;
}

/* Mobile QR button */
.header-qr-btn {
    background: none;
    border: none;
    color: #1f5eff;
    padding: 8px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.header-qr-btn:hover {
    background: #eff6ff;
}

/* ── Main ───────────────────────────────────────── */
.user-main {
    flex: 1;
    padding: 32px 0;
}

@media (max-width: 767px) {
    .user-main {
        padding-bottom: 88px; /* 64px bottom nav + 24px gap */
    }
}

/* ── Bottom Navigation (Mobile only) ────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 768px) {
    .bottom-nav { display: none; }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #6b7280;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    gap: 2px;
    transition: color .15s;
}

.bottom-nav-item.active {
    color: var(--u-primary);
}

.bottom-nav-item:hover {
    color: var(--u-primary);
    text-decoration: none;
}

.home-placeholder {
    padding: 80px 0;
}

.home-placeholder-text {
    color: var(--u-text-sub);
    font-size: 15px;
    margin: 0;
}

/* ── Footer ─────────────────────────────────────── */
.user-footer {
    background: #fff;
    border-top: 1px solid var(--u-border);
    padding: 18px 0;
    text-align: center;
    color: var(--u-text-sub);
    font-size: 13px;
}
