/* Shared visual language for the existing PHP / Bootstrap views. */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #fff;
  --surface2: #f1f3f7;
  --border: #e4e7ed;
  --border2: #cdd4df;
  --text: #202735;
  --muted: #697386;
  --accent: #3659db;
  --accent2: #3659db;
  --accent-soft: #edf1ff;
  --shadow: rgba(54,89,219,.12);
  --card-shadow: 0 2px 6px rgba(24,39,75,.025);
  --topbar-bg: rgba(255,255,255,.95);
  --sidenav-bg: #fff;
  --radius: 16px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10131b;
  --surface: #191e29;
  --surface2: #222938;
  --border: #2c3444;
  --border2: #404d63;
  --text: #eef1f7;
  --muted: #a5afc1;
  --accent: #9aaeff;
  --accent2: #9aaeff;
  --accent-soft: #293454;
  --shadow: rgba(0,0,0,.2);
  --card-shadow: 0 2px 8px rgba(0,0,0,.1);
  --topbar-bg: rgba(25,30,41,.95);
  --sidenav-bg: #191e29;
}
body { font-family: 'Plus Jakarta Sans', 'Noto Sans JP', sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.65; }
::selection { background: #dce4ff; color: #192b6e; }
:where(a,button,input,select,textarea,[tabindex]):focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 10000; padding: 12px 20px; background: var(--surface); color: var(--text); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.topbar { height: 76px; padding-inline: 28px; gap: 16px; }
.topbar-logo { gap: 12px; }
.topbar-logo .icon-wrap, .logo-icon { background: #3659db; box-shadow: none; border-radius: 12px; }
.topbar-logo .brand-name { font-size: .9rem; font-weight: 700; letter-spacing: -.025em; }
.theme-pill { border: 1px solid var(--border); background: var(--surface2); box-shadow: none; padding: 3px; }
.theme-pill-opt { width: 36px; height: 36px; }
.theme-pill-opt.active, [data-theme="dark"] .theme-pill-opt.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px var(--shadow); }
.user-avatar-btn { min-height: 44px; padding: 5px 12px 5px 6px; border: 1px solid var(--border); box-shadow: none; }
.user-avatar-icon { background: var(--accent-soft); width: 30px; height: 30px; }
.user-avatar-icon i { color: var(--accent); }
.user-popover-menu { border: 1px solid var(--border); padding: 6px; border-radius: 14px; box-shadow: 0 14px 40px var(--shadow); }
.user-popover-item { min-height: 44px; }
.layout { min-height: calc(100vh - 76px); }
.sidenav { width: 232px; top: 76px; height: calc(100vh - 76px); padding: 30px 16px 20px; gap: 8px; }
.nav-caption { padding: 0 14px 12px; color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .14em; }
.sidenav-item { min-height: 48px; padding: 12px 14px; font-size: .82rem; gap: 12px; border: 1px solid transparent; border-radius: 10px; }
.sidenav-item.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 700; }
.sidenav-item i { width: 20px; text-align: center; }
.nav-footer { margin-top: auto; padding: 24px 14px 4px; font-size: .7rem; color: var(--muted); line-height: 1.8; }
.nav-footer span { display: block; font-size: .6rem; letter-spacing: .1em; margin-top: 6px; }
.main-content { padding: 40px clamp(24px, 3.5vw, 64px) 80px; max-width: 1540px; margin: 0 auto; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.eyebrow { color: var(--accent); font-size: .65rem; font-weight: 800; letter-spacing: .16em; margin-bottom: 9px; }
.workspace-heading h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.04em; font-weight: 700; margin: 0; line-height: 1.4; }
.workspace-heading p, .page-intro { margin: 8px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.8; }
.workspace-heading [hidden] { display: none; }
.section-head { font-size: .85rem; font-weight: 700; letter-spacing: 0; color: var(--text); margin: 24px 0 16px; }
.stats-grid { gap: 16px; margin-bottom: 28px; }
.stat-card { display: flex; flex-direction: column; align-items: flex-start; padding: 24px; border-radius: var(--radius); box-shadow: var(--card-shadow); min-width: 0; }
.stat-symbol { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; background: var(--accent-soft); border-radius: 11px; color: var(--accent); font-size: .95rem; margin-bottom: 22px; }
.stat-label { order: 1; margin-bottom: 8px; font-size: .74rem; }
.stat-num { order: 2; background: none; -webkit-text-fill-color: currentColor; color: var(--text); font-size: clamp(1.35rem, 2vw, 2rem); font-weight: 700; letter-spacing: -.05em; line-height: 1.35; margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.card, .settings-card, .pl-header-card { border-radius: var(--radius); box-shadow: var(--card-shadow); margin-bottom: 24px; }
.card { color: var(--text); }
.card-head, .settings-card-header { padding: 20px 24px; background: var(--surface); gap: 12px; }
.card-head-title, .settings-card-header span { font-size: .88rem; gap: 10px; line-height: 1.5; }
.card-body, .settings-card-body { padding: 24px; }
.form-label, .form-label-sm { color: var(--text); font-size: .78rem; font-weight: 500; letter-spacing: 0; text-transform: none; margin-bottom: 8px; }
.form-control, .form-select { border: 1px solid var(--border2); background-color: var(--surface); border-radius: 9px; min-height: 44px; font-size: .875rem; }
.form-control::placeholder { color: var(--muted); opacity: .75; }
.form-control:focus, .form-select:focus { background-color: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-primary-grad, .btn-save, .btn-login, .btn-verify { background: #3659db; color: #fff; border-radius: 9px; min-height: 44px; padding: 12px 20px; box-shadow: 0 2px 3px rgba(24,39,75,.1); font-weight: 600; }
.btn-primary-grad:hover:not(:disabled), .btn-save:hover:not(:disabled), .btn-login:hover:not(:disabled), .btn-verify:hover:not(:disabled) { background: #2948bf; opacity: 1; box-shadow: 0 4px 10px var(--shadow); }
.btn-ghost, .btn-ghost-sm, .share-btn { min-height: 40px; border-radius: 9px; }
.btn-icon { width: 36px; height: 36px; border-radius: 9px; }
.data-table th { background: var(--surface2); font-size: .69rem; font-weight: 500; padding: 13px 24px; letter-spacing: .02em; }
.data-table td { padding: 18px 24px; border-bottom-color: var(--border); font-size: .82rem; }
[data-theme="dark"] .data-table td { border-bottom-color: var(--border); }
.data-table tbody tr:hover td { background: var(--accent-soft); }
.drop-zone { background: var(--surface2); border: 1.5px dashed var(--border2); border-radius: 12px; padding: 44px 20px; }
.drop-zone .dz-icon { color: var(--accent); font-size: 2rem; margin-bottom: 18px; }
.drop-zone:hover, .drop-zone.drag-over { background: var(--accent-soft); }
.drop-zone .hint { margin-top: 8px; }
.progress-fill { background: #3659db; }
.modal-content { border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.2); }
.modal-header, .modal-footer { padding: 18px 24px; }
.page-wrap { padding-top: 40px; }
.page-heading { font-size: 1.75rem; letter-spacing: -.035em; margin-bottom: 10px; }
.page-intro { margin-bottom: 28px; }
.danger-zone-card { border-radius: var(--radius); box-shadow: none; }
.bottomnav-item { min-height: 54px; justify-content: center; gap: 6px; }
.bottomnav-item.active { background: var(--accent-soft); border-radius: 10px; }
.bottomnav-inner { gap: 6px; padding: 0 10px; }
.player-wrap { padding-top: 32px; }
.player-outer { border-radius: 16px; overflow: hidden; }
.video-title, .pl-title { letter-spacing: -.035em; line-height: 1.5; }
.video-card { border-radius: 12px; box-shadow: var(--card-shadow); }
.pl-icon-wrap { background: #3659db; box-shadow: none; }
.uploader-avatar, .play-icon, .topbar-official-badge { background: #3659db; }
.btn-resend { min-height: 44px; }
.description-box { border-radius: 12px; }

/* Authentication: an editorial introduction beside a focused form. */
.auth-page { padding: 24px; display: flex; min-height: 100svh; background: var(--surface); }
.auth-page::before { display: none; }
.auth-page .theme-pill-wrap { top: 36px; right: 42px; }
.auth-layout { width: 100%; max-width: 1440px; margin: auto; display: grid; grid-template-columns: 1.08fr 1fr; min-height: min(820px, calc(100svh - 48px)); gap: 32px; }
.auth-story { position: relative; isolation: isolate; display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; padding: clamp(32px, 4vw, 64px); background: #142344; color: #fff; }
.story-brand { display: flex; align-items: center; gap: 12px; font-size: .82rem; font-weight: 600; }
.story-brand-mark { width: 34px; height: 34px; border-radius: 10px; background: #d9e3ff; display: grid; place-items: center; color: #233b72; }
.story-copy { margin-top: clamp(48px, 7vh, 88px); position: relative; z-index: 1; }
.story-copy .eyebrow { color: #b0c4ff; font-size: .64rem; margin-bottom: 20px; }
.story-copy h2 { font-size: clamp(2rem, 3.3vw, 3.2rem); line-height: 1.55; letter-spacing: -.06em; font-weight: 500; margin: 0 0 22px; }
.story-copy p { color: #b8c5dc; font-size: .83rem; line-height: 2; margin: 0; }
.story-art { position: relative; margin: 38px 0 26px; width: 100%; aspect-ratio: 1.9; }
.story-frame { position: absolute; inset: 0 6%; border-radius: 16px; border: 1px solid #768cab; background: #8ea6b9; overflow: hidden; box-shadow: 0 24px 50px #08142b66; transform: rotate(-5deg); }
.story-frame::before { content: ''; position: absolute; inset: 0; background: linear-gradient(165deg,#879fbd 0%,#c2d0d3 56%,#e6dbca 100%); }
.art-sun { position: absolute; width: 17%; aspect-ratio: 1; background: #f5e9c9; border-radius: 50%; top: 17%; left: 63%; }
.art-mountain { position: absolute; width: 110%; height: 100%; background: #536f73; left: -8%; top: 27%; clip-path: polygon(0 64%,35% 8%,62% 63%,83% 35%,100% 65%,100% 100%,0 100%); }
.art-mountain.front { background: #2c4b53; top: 50%; left: 0; transform: scaleX(-1); }
.art-play { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%); display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #ffffffdd; color: #233b49; box-shadow: 0 4px 20px #15273b33; font-size: 15px; }
.art-timeline { position: absolute; left: 7%; right: 7%; bottom: 12%; height: 3px; background: #ffffff55; border-radius: 10px; }
.art-timeline::before { content: ''; display: block; width: 38%; height: 100%; background: #fff; }
.story-art-label { position: absolute; right: 0; bottom: -5px; padding: 12px 18px; background: #f7f9fe; border-radius: 10px; color: #233b49; box-shadow: 0 8px 28px #08142b33; font-size: .72rem; transform: rotate(3deg); display: flex; gap: 10px; align-items: center; }
.story-art-label i { color: #3659db; }
.story-footer { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: auto; padding-top: 28px; font-size: .7rem; color: #b8c5dc; }
.story-footer span { display: inline-flex; gap: 8px; align-items: center; }
.auth-page .login-wrap { max-width: 400px; width: 100%; align-self: center; justify-self: center; margin: 70px 0 40px; animation: none; }
.auth-page .logo-area { text-align: left; margin-bottom: 32px; }
.auth-page .logo-icon { width: 44px; height: 44px; margin-bottom: 24px; border-radius: 12px; }
.auth-page .logo-icon i { font-size: 1.05rem; }
.auth-page .logo-text { font-size: 1.8rem; letter-spacing: -.05em; font-weight: 700; line-height: 1.4; margin: 0; }
.auth-page .logo-sub { font-size: .82rem; margin-top: 12px; line-height: 1.8; }
.auth-page .card-login { padding: 0; background: transparent; border: none; box-shadow: none; border-radius: 0; }
.auth-page .input-wrap { margin-bottom: 22px; }
.auth-page .form-control { min-height: 50px; padding-left: 40px; }
.auth-page .input-icon { left: 15px; }
.auth-page .btn-login, .auth-page .btn-verify { min-height: 50px; margin-top: 22px; }
.auth-page .hcaptcha-wrap { margin-block: 24px; min-height: 78px; }
.auth-page .footer-note { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 30px; font-size: .73rem; }
.auth-page .otp-boxes { gap: 10px; }
.auth-page .otp-box { flex: 1; min-width: 0; background: var(--surface); border-color: var(--border2); border-radius: 10px; color: var(--text); }

@media (min-width: 769px) and (max-width: 1100px) {
  .sidenav { width: 200px; padding-inline: 12px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-card { position: relative; padding: 22px; }
  .stat-symbol { position: absolute; right: 20px; top: 20px; width: 30px; height: 30px; }
  .stat-label { padding-right: 34px; }
  .auth-layout { gap: 40px; }
  .auth-page .login-wrap { padding-right: 24px; }
}
@media (max-width: 768px) {
  .topbar { height: 68px; padding-inline: 16px; gap: 8px; }
  .topbar-actions { gap: 8px; }
  .sidenav { display: none; }
  .layout { min-height: calc(100svh - 68px); }
  .main-content { padding: 28px 18px 100px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 28px; }
  .workspace-heading p { font-size: .76rem; }
  .workspace-heading .btn-primary-grad { font-size: .78rem; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .stat-card { padding: 18px 16px; }
  .stat-symbol { margin-bottom: 16px; width: 34px; height: 34px; }
  .stat-label { font-size: .66rem; }
  .card-head, .settings-card-header { padding: 18px; }
  .card-body, .settings-card-body { padding: 18px; }
  .data-table th, .data-table td { padding-inline: 16px; }
  .page-wrap { padding-top: 28px; }
  .page-heading { font-size: 1.5rem; }
  .auth-page { padding: 0; }
  .auth-page .theme-pill-wrap { position: absolute; top: 18px; right: 18px; }
  .auth-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100svh; gap: 0; }
  .auth-story { border-radius: 0; padding: 26px 24px; min-height: 100px; }
  .story-brand { max-width: calc(100% - 80px); font-size: .7rem; gap: 8px; }
  .story-brand-mark { flex-shrink: 0; width: 28px; height: 28px; }
  .story-copy { margin-top: 32px; }
  .story-copy .eyebrow { margin-bottom: 10px; font-size: .58rem; }
  .story-copy h2 { font-size: 1.65rem; margin-bottom: 0; line-height: 1.55; }
  .story-copy h2 br { display: none; }
  .story-copy p, .story-art, .story-footer { display: none; }
  .auth-page .login-wrap { max-width: 448px; margin: 0; padding: 34px 24px 20px; align-self: start; }
  .auth-page .logo-icon { display: none; }
  .auth-page .logo-text { font-size: 1.5rem; }
  .auth-page .logo-area { margin-bottom: 26px; }
  .auth-page .form-control, .auth-page .otp-box { font-size: 16px; }
  .auth-page .footer-note { margin-bottom: 0; }
}
@media (max-width: 359px) {
  .auth-page .login-wrap { padding-inline: 8px; }
  .story-brand { font-size: .62rem; }
  .topbar { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
