@import url("https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700&display=swap");

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "M PLUS Rounded 1c", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    color: #0f172a;
    background: #f4f7fb;
    line-height: 1.6;
}

body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(148, 163, 184, 0.25);
    z-index: 5;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #06b6d4;
}

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

.hidden {
    display: none !important;
}

.app-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.app-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(1200px 600px at 10% -10%, #c7f9ff 0%, transparent 60%),
        radial-gradient(900px 500px at 85% 0%, #ffe7d1 0%, transparent 60%),
        linear-gradient(180deg, #f7fbff 0%, #f4f7fb 100%);
    pointer-events: none;
}

.app-blob {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    opacity: 0.7;
    animation: float 14s ease-in-out infinite;
}

.app-blob.blob-1 {
    top: 8%;
    left: 6%;
    background: radial-gradient(circle at 30% 30%, #a7f3d0, #38bdf8);
}

.app-blob.blob-2 {
    top: -6%;
    right: 8%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle at 30% 30%, #fde68a, #fca5a5);
    animation-delay: -4s;
}

.app-blob.blob-3 {
    bottom: 6%;
    right: 18%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle at 30% 30%, #bfdbfe, #5eead4);
    animation-delay: -8s;
}

.app-shell {
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

.app-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.app-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
}

.app-header-inner {
    padding: 20px 0;
}

.app-main {
    padding: 28px 0 40px;
}

.app-card {
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.app-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
}

.app-alert-warning {
    background: rgba(254, 243, 199, 0.9);
    border-color: rgba(251, 191, 36, 0.4);
    color: #92400e;
}

.app-alert-info {
    background: rgba(219, 234, 254, 0.9);
    border-color: rgba(59, 130, 246, 0.3);
    color: #1e3a8a;
}

.app-alert-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-reveal {
    animation: rise 0.6s ease-out both;
}

.app-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
}

.app-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.app-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(120deg, #06b6d4, #14b8a6);
    box-shadow: 0 16px 30px rgba(20, 184, 166, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.app-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px rgba(20, 184, 166, 0.35);
}

.app-button-compact {
    min-height: 40px;
    padding: 0 18px;
    font-size: 0.85rem;
}

.app-button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    background: rgba(255, 255, 255, 0.85);
    transition: transform 0.2s ease, background 0.2s ease;
}

.app-button-secondary:hover {
    transform: translateY(-2px);
    background: #ffffff;
}

.app-button-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(120deg, #10b981, #84cc16);
    box-shadow: 0 16px 30px rgba(16, 185, 129, 0.25);
    cursor: pointer;
}

.app-button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(120deg, #f43f5e, #fb7185);
    box-shadow: 0 16px 30px rgba(244, 63, 94, 0.25);
    cursor: pointer;
}

.app-link {
    font-weight: 700;
    color: #0ea5e9;
}

.app-link:hover {
    color: #0369a1;
}

.app-link-danger {
    font-weight: 700;
    color: #f43f5e;
}

.app-input {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

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

.app-table thead th {
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    padding: 12px 0;
}

.app-table tbody td {
    padding: 12px 0;
    color: #334155;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.app-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #0f172a;
}

.nav-link.is-active {
    background: rgba(14, 165, 233, 0.15);
    color: #0284c7;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user-trigger {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    gap: 4px;
    padding: 6px;
    color: #64748b;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #64748b;
}

.nav-mobile {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 18px 20px;
    position: relative;
    z-index: 21;
}

.nav-mobile.is-open {
    display: block;
}

.nav-mobile-links {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.nav-mobile-link {
    display: block;
    border-radius: 18px;
    padding: 10px 14px;
    font-weight: 600;
    color: #64748b;
}

.nav-mobile-link.is-active {
    background: rgba(14, 165, 233, 0.15);
    color: #0284c7;
}

.nav-mobile-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 12px;
}

.nav-user-name {
    font-weight: 600;
    color: #334155;
}

.nav-user-email {
    font-size: 0.85rem;
    color: #64748b;
}

.app-dropdown {
    position: relative;
}

.app-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    display: none;
    z-index: 30;
}

.app-dropdown.is-open .app-dropdown-menu {
    display: block;
}

.app-dropdown-panel {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
}

.dropdown-link {
    display: block;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.dropdown-link:hover {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}

.dropdown-right .app-dropdown-menu {
    right: 0;
    left: auto;
}

.dropdown-left .app-dropdown-menu {
    left: 0;
}

.dropdown-w-48 {
    width: 192px;
}

.dropdown-w-48 .app-dropdown-menu {
    width: 192px;
}

.app-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 24px;
}

.app-modal.is-open {
    display: flex;
}

.app-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
}

.app-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    z-index: 1;
}

.app-modal__panel {
    padding: 16px;
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 520px; }
.modal-lg { max-width: 640px; }
.modal-xl { max-width: 720px; }
.modal-2xl { max-width: 820px; }

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 16px;
    gap: 18px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 26px;
}

.auth-logo {
    display: flex;
    justify-content: center;
}

.profile-card {
    padding: 20px;
}

.hero-grid {
    display: grid;
    gap: 40px;
    align-items: center;
}

.hero-title {
    margin-top: 16px;
    font-size: 2.4rem;
    line-height: 1.2;
    font-weight: 700;
    color: #0f172a;
}

.hero-copy {
    margin-top: 16px;
    font-size: 1rem;
    color: #475569;
}

.hero-actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.feature-card {
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.8);
    padding: 16px;
}

.show-desktop {
    display: none;
}

.modal-input {
    width: 100%;
    max-width: 320px;
}

.no-scroll {
    overflow: hidden;
}

.app-download-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.35);
    z-index: 80;
}

.app-download-overlay.is-active {
    display: flex;
}

.app-download-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.95);
    padding: 28px 32px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
    text-align: center;
}

.app-download-text {
    font-weight: 600;
    color: #0f172a;
}

.app-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid rgba(14, 165, 233, 0.2);
    border-top-color: #0ea5e9;
    animation: spin 0.9s linear infinite;
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-user {
        display: none;
    }

    .app-container {
        padding: 0 16px;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2rem;
    }

    .app-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-table thead,
    .app-table tbody {
        display: table;
        width: 100%;
    }

    .app-table thead th {
        white-space: nowrap;
    }

    .app-table tbody td {
        white-space: normal;
        min-width: 120px;
    }

    .nav-mobile {
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .show-desktop {
        display: inline;
    }

    .profile-card {
        padding: 32px;
    }
}

@media (max-width: 640px) {
    .app-header-inner {
        padding: 16px 0;
    }

    .nav-bar {
        height: 56px;
    }

    .app-container {
        padding: 0 14px;
    }

    .p-6 {
        padding: 18px;
    }

    .p-4 {
        padding: 14px;
    }

    .text-2xl {
        font-size: 1.4rem;
    }

    .app-button,
    .app-button-secondary,
    .app-button-success,
    .app-button-danger {
        min-height: 44px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }
}

@keyframes float {
    0%,
    100% { transform: translateY(0); }
    50% { transform: translateY(12px); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Utility helpers used in views */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-20 { width: 80px; }
.h-9 { height: 36px; }
.h-10 { height: 40px; }
.h-20 { height: 80px; }
.max-w-3xl { max-width: 720px; margin: 0 auto; }
.max-w-5xl { max-width: 900px; margin: 0 auto; }
.max-w-6xl { max-width: 1040px; margin: 0 auto; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-3 { margin-bottom: 12px; }
.ms-1 { margin-inline-start: 4px; }
.ms-2 { margin-inline-start: 8px; }
.ms-3 { margin-inline-start: 12px; }
.ms-4 { margin-inline-start: 16px; }
.text-sm { font-size: 0.85rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.1rem; }
.text-2xl { font-size: 1.6rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-500 { color: #64748b; }
.text-slate-900 { color: #0f172a; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-rose-600 { color: #e11d48; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-1 > * + * { margin-top: 8px; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
