*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --bg:#0d0d14;--bg2:#15151f;--bg3:#1e1e2e;--bg4:#282840;
  --text:#e8e8f0;--text2:#a0a0b8;--text3:#6a6a80;
  --accent1:#00e5ff;--accent2:#b84dff;
  --grad:linear-gradient(135deg,var(--accent1),var(--accent2));
  --green:#06c755;--red:#ff4757;--yellow:#ffd93d;
  --card-radius:16px;--btn-radius:12px;
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --cal-border:rgba(255,255,255,0.09);
}
html{font-size:16px}
body{font-family:'Noto Sans JP',sans-serif;background:var(--bg);color:var(--text);min-height:100vh;min-height:100dvh;overflow-x:hidden;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
button{font-family:inherit;border:none;cursor:pointer;background:none;color:inherit}
input,textarea,select{font-family:inherit;border:none;outline:none;background:var(--bg3);color:var(--text);border-radius:var(--btn-radius);padding:12px 16px;font-size:.95rem;width:100%}
input[type=radio],input[type=checkbox]{width:auto;padding:0;background:none;border-radius:0}
input::placeholder,textarea::placeholder{color:var(--text3)}
textarea{resize:vertical;min-height:80px}
textarea.auto-resize{resize:none !important;overflow-y:hidden;transition:height 0.1s ease}
/* Autofill override — Dark theme (default) */
input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active,
textarea:-webkit-autofill,textarea:-webkit-autofill:hover,textarea:-webkit-autofill:focus,textarea:-webkit-autofill:active,
select:-webkit-autofill,select:-webkit-autofill:hover,select:-webkit-autofill:focus,select:-webkit-autofill:active{
  -webkit-box-shadow: 0 0 0px 1000px #1e1e2e inset !important;
  box-shadow: 0 0 0px 1000px #1e1e2e inset !important;
  -webkit-text-fill-color: #e8e8f0 !important;
  color: #e8e8f0 !important;
  caret-color: #e8e8f0 !important;
  background-color: #1e1e2e !important;
  transition: background-color 5000s ease-in-out 0s !important;
}
/* Autofill override — Light theme */
body.light-theme input:-webkit-autofill,body.light-theme input:-webkit-autofill:hover,body.light-theme input:-webkit-autofill:focus,body.light-theme input:-webkit-autofill:active,
body.light-theme textarea:-webkit-autofill,body.light-theme textarea:-webkit-autofill:hover,body.light-theme textarea:-webkit-autofill:focus,body.light-theme textarea:-webkit-autofill:active,
body.light-theme select:-webkit-autofill,body.light-theme select:-webkit-autofill:hover,body.light-theme select:-webkit-autofill:focus,body.light-theme select:-webkit-autofill:active{
  -webkit-box-shadow: 0 0 0px 1000px #e8eaf2 inset !important;
  box-shadow: 0 0 0px 1000px #e8eaf2 inset !important;
  -webkit-text-fill-color: #1a1a30 !important;
  color: #1a1a30 !important;
  caret-color: #1a1a30 !important;
  background-color: #e8eaf2 !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

.screen{display:none;flex-direction:column;min-height:100vh;min-height:100dvh;position:relative;animation:fadeIn .25s ease}
.screen.active{display:flex}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

/* Header */
.header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:var(--bg);position:sticky;top:0;z-index:50}
.header-title{font-weight:700;font-size:1.1rem}
.header-back{display:flex;align-items:center;gap:4px;font-size:.9rem;color:var(--accent1)}
.avatar-sm{width:36px;height:36px;border-radius:50%;background:var(--grad);display:flex;align-items:center;justify-content:center;font-size:.85rem;font-weight:700;flex-shrink:0}

/* Footer Nav */
.footer-nav{position:fixed;bottom:0;left:0;right:0;background:var(--bg2);border-top:1px solid var(--bg4);display:flex;justify-content:space-around;padding:8px 0 calc(8px + var(--safe-bottom));z-index:100}
.footer-nav button{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:.65rem;color:var(--text3);transition:color .2s}
.footer-nav button.active{color:var(--accent1)}
.footer-nav button i{width:22px;height:22px}

/* FAB */
.fab{position:fixed;bottom:calc(72px + var(--safe-bottom));right:20px;width:56px;height:56px;border-radius:50%;background:var(--grad);display:flex;align-items:center;justify-content:center;box-shadow:0 4px 20px rgba(0,229,255,.3);z-index:90;transition:transform .2s}
.fab:active{transform:scale(.92)}

/* Cards */
.event-card{background:var(--bg3);border-radius:var(--card-radius);padding:16px;margin-bottom:12px;transition:transform .15s;border-left:3px solid var(--accent1)}
.event-card:active{transform:scale(.98)}
.event-card .card-title{font-weight:700;font-size:1rem;margin-bottom:6px}
.event-card .card-meta{display:flex;flex-wrap:wrap;gap:8px;font-size:.8rem;color:var(--text2);margin-bottom:8px}
.event-card .card-meta span{display:flex;align-items:center;gap:3px}
.event-card .card-bottom{display:flex;justify-content:space-between;align-items:center}
.event-card .card-tags{display:flex;gap:6px;flex-wrap:wrap}
.tag{background:var(--bg4);color:var(--accent1);font-size:.7rem;padding:3px 10px;border-radius:20px;font-weight:500}
.tag.full{background:var(--red);color:#fff}
.participants{font-size:.85rem;font-weight:700;background:var(--grad);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:12px 24px;border-radius:var(--btn-radius);font-size:.95rem;font-weight:700;transition:all .2s}
.btn:active{transform:scale(.96)}
.btn-primary{background:var(--grad);color:#0d0d14}
.btn-outline{border:1.5px solid var(--bg4);color:var(--text)}
.btn-green{background:var(--green);color:#fff}
.btn-white{background:#fff;color:#222}
.btn-red{background:var(--red);color:#fff}
.btn-sm{padding:8px 16px;font-size:.8rem}
.btn-full{width:100%}

/* Toast */
.toast{position:fixed;bottom:90px;left:50%;transform:translateX(-50%) translateY(80px);background:var(--bg3);color:var(--text);padding:14px 24px;border-radius:var(--card-radius);font-size:.9rem;font-weight:500;box-shadow:0 8px 30px rgba(0,0,0,.5);opacity:0;transition:all .35s ease;z-index:200;pointer-events:none;border:1px solid var(--accent1);white-space:normal;width:max-content;max-width:calc(100vw - 40px);text-align:center;line-height:1.5}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* Chips */
.chip{display:inline-flex;align-items:center;padding:7px 14px;border-radius:20px;font-size:.8rem;background:var(--bg4);color:var(--text2);cursor:pointer;transition:all .2s;white-space:nowrap;user-select:none}
.chip.active{background:var(--accent1);color:var(--bg)}

/* Scrollbar */
::-webkit-scrollbar{width:4px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--bg4);border-radius:2px}

/* Main content area padding for footer */
.main-content{flex:1;padding:0 16px 90px;overflow-y:auto}

/* ========================
   SCREEN 1: Login / LP
   ======================== */
#screen-login{background:linear-gradient(160deg,#0d0d14 0%,#1a0a2e 50%,#0d1420 100%);justify-content:center;align-items:center;padding:40px 24px}
.login-logo{font-size:2.4rem;font-weight:900;background:var(--grad);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;margin-bottom:8px;letter-spacing:2px}
.login-icon{font-size:3.5rem;margin-bottom:16px}
.login-tagline{color:var(--text2);font-size:1rem;margin-bottom:48px;text-align:center}
.login-buttons{display:flex;flex-direction:column;gap:14px;width:100%;max-width:320px}
.login-buttons .btn{font-size:.95rem;padding:14px;border-radius:var(--btn-radius)}

/* ========================
   SCREEN 2: Calendar
   ======================== */
.calendar-header{display:flex;align-items:center;justify-content:space-between;padding:4px 0 4px}
.calendar-header h2{font-size:1rem;font-weight:700}
.calendar-nav{display:flex;gap:8px}
.calendar-nav button{width:32px;height:32px;border-radius:50%;background:var(--bg3);display:flex;align-items:center;justify-content:center}
.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;margin-bottom:6px}
.cal-day-label{text-align:center;font-size:.65rem;color:var(--text3);padding:2px 0;font-weight:500}
.cal-day-label:first-child{color:var(--red)}
.cal-day-label:last-child{color:var(--accent1)}
.cal-cell{position:relative;height:44px;display:flex;align-items:center;justify-content:center;border-radius:8px;font-size:1.1rem;font-weight:700;cursor:pointer;transition:all .15s;border:1px solid var(--cal-border)}
.cal-cell:hover{background:var(--bg3)}
.cal-cell.today{background:var(--bg4);font-weight:700}
.cal-cell.selected{background:var(--accent1);color:var(--bg);font-weight:700;border-color:transparent}
.cal-cell.other-month{color:var(--text3);opacity:.3}
.cal-cell .badge{position:absolute;top:1px;right:1px;width:20px;height:20px;border-radius:50%;background:var(--grad);font-size:.65rem;font-weight:700;display:flex;align-items:center;justify-content:center;color:var(--bg)}
.cal-cell.sunday{color:var(--red)}
.cal-cell.saturday{color:var(--accent1)}
.cal-cell.selected.saturday,.cal-cell.selected.sunday{color:var(--bg)}
.event-list-section{overflow-y:auto;transition:max-height .35s ease}
.event-list-section h3{font-size:.85rem;color:var(--text2);margin-bottom:8px;font-weight:500}

/* Calendar Filter */
.cal-filter{display:flex;gap:8px;align-items:center;padding:4px 0 6px;flex-wrap:wrap}
.cal-filter select{width:auto;min-width:100px;padding:6px 10px;font-size:.78rem;border-radius:8px;background:var(--bg3);color:var(--text);appearance:auto}
.cal-filter-tags{display:flex;gap:4px;flex:1;align-items:center;flex-wrap:wrap}
.cal-filter-tag-input{width:100px;padding:6px 10px;font-size:.78rem}
.cal-filter-chip{display:inline-flex;align-items:center;gap:3px;padding:3px 10px;border-radius:14px;font-size:.7rem;background:var(--accent1);color:var(--bg);font-weight:500}
.cal-filter-chip .remove{cursor:pointer;font-size:.8rem;margin-left:2px;opacity:.7}
.cal-filter-chip .remove:hover{opacity:1}

/* ========================
   SCREEN 3: Search
   ======================== */
.search-bar{position:relative;margin-bottom:12px}
.search-bar input{padding-left:42px;background:var(--bg3);border:1px solid var(--bg4)}
.search-bar i{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--text3)}
.filter-row{display:flex;gap:8px;overflow-x:auto;padding-bottom:12px;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.filter-row::-webkit-scrollbar{display:none}

/* ========================
   SCREEN 4: Event Detail
   ======================== */
.detail-hero{padding:0 0 16px}
.detail-hero h1{font-size:1.5rem;font-weight:900;margin-bottom:12px;line-height:1.3}
.detail-info{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
.detail-info-row{display:flex;align-items:center;gap:10px;font-size:.9rem;color:var(--text2)}
.detail-info-row i{flex-shrink:0;color:var(--accent1)}
.detail-section{margin-bottom:20px}
.detail-section h3{font-size:.85rem;color:var(--text3);margin-bottom:8px;text-transform:uppercase;letter-spacing:1px}
.detail-desc{font-size:.9rem;line-height:1.6;color:var(--text2)}
.organizer-row{display:flex;align-items:center;gap:12px;background:var(--bg3);padding:12px;border-radius:var(--card-radius)}
.organizer-rating{display:flex;gap:8px;font-size:.8rem}
.organizer-rating span{display:flex;align-items:center;gap:2px}
.participant-avatars{display:flex;gap:-8px;align-items:center}
.participant-avatars .avatar-sm{margin-left:-8px;border:2px solid var(--bg)}
.participant-avatars .avatar-sm:first-child{margin-left:0}
.participant-more{font-size:.8rem;color:var(--text2);margin-left:8px}
.detail-actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.map-placeholder{background:var(--bg3);border-radius:var(--card-radius);padding:24px;text-align:center;color:var(--text3);font-size:.85rem;border:1px dashed var(--bg4)}

/* ========================
   SCREEN 5: Create Event
   ======================== */
.form-group{margin-bottom:16px}
.form-group label{display:block;font-size:.8rem;color:var(--text2);margin-bottom:6px;font-weight:500}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tag-selector{display:flex;flex-wrap:wrap;gap:8px}
.tag-chip{padding:8px 16px;border-radius:20px;font-size:.8rem;background:var(--bg4);color:var(--text2);cursor:pointer;transition:all .2s;border:1.5px solid transparent;user-select:none}
.tag-chip.selected{background:transparent;border-color:var(--accent1);color:var(--accent1)}

/* ========================
   SCREEN 6: Chat
   ======================== */
.chat-container{flex:1;display:flex;flex-direction:column;padding-bottom:150px}
.chat-messages{flex:1;padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:10px}
.msg{max-width:80%;padding:10px 14px;border-radius:16px;font-size:.9rem;line-height:1.5;position:relative;white-space:pre-wrap;word-break:break-word}
.msg-other{background:#1e2040;align-self:flex-start;border-bottom-left-radius:4px}
.msg-self{background:linear-gradient(135deg,#00b4d8,#7b2ff7);align-self:flex-end;border-bottom-right-radius:4px;color:#fff}
.msg-name{font-size:.7rem;color:var(--accent1);margin-bottom:2px;font-weight:700}
.msg-time{font-size:.6rem;color:var(--text3);margin-top:4px;text-align:right}
.msg-self .msg-time{color:rgba(255,255,255,0.65)}
.msg-other .msg-time{text-align:left}
.chat-input-bar{position:fixed;bottom:0;left:0;right:0;display:flex;align-items:flex-end;gap:8px;padding:10px 16px calc(10px + var(--safe-bottom));background:var(--bg2);border-top:1px solid var(--bg4);z-index:60}
.chat-input-bar textarea{flex:1;border-radius:12px;padding:10px 16px;resize:none;height:80px;overflow-y:auto}
.chat-input-bar button{width:42px;height:42px;border-radius:50%;background:var(--grad);display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-bottom:1px}

/* ========================
   SCREEN 7: Rating
   ======================== */
.rating-header{text-align:center;padding:24px 0 16px}
.rating-header h2{font-size:1.2rem;font-weight:700;margin-bottom:4px}
.rating-header p{color:var(--text2);font-size:.85rem}
.rating-card{display:flex;align-items:center;justify-content:space-between;background:var(--bg3);border-radius:var(--card-radius);padding:14px 16px;margin-bottom:10px}
.rating-user{display:flex;align-items:center;gap:10px}
.rating-user span{font-weight:500;font-size:.95rem}
.rating-btns{display:flex;gap:8px}
.rating-btns button{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:1.2rem;transition:all .2s}
.rating-btns .good{background:rgba(6,199,85,.15);color:var(--green)}
.rating-btns .good.active{background:var(--green);color:#fff}
.rating-btns .bad{background:rgba(255,71,87,.15);color:var(--red)}
.rating-btns .bad.active{background:var(--red);color:#fff}

/* ========================
   SCREEN 8: My Page
   ======================== */
.mypage-profile{text-align:center;padding:20px 0}
.mypage-avatar{width:80px;height:80px;border-radius:50%;background:var(--grad);margin:0 auto 12px;display:flex;align-items:center;justify-content:center;font-size:2rem}
.mypage-name{font-size:1.2rem;font-weight:700;margin-bottom:4px}
.mypage-bio{color:var(--text2);font-size:.85rem;margin-bottom:12px}
.mypage-stats{display:flex;justify-content:center;gap:16px;font-size:.85rem;color:var(--text2);margin-bottom:12px}
.mypage-stats span{font-weight:700;color:var(--text)}
.sub-badge{display:inline-block;background:var(--bg4);color:var(--text2);padding:4px 14px;border-radius:20px;font-size:.75rem;font-weight:700;margin-bottom:16px}
.menu-list{display:flex;flex-direction:column;gap:2px}
.menu-item{display:flex;align-items:center;justify-content:space-between;padding:16px;background:var(--bg3);font-size:.95rem;transition:background .15s}
.menu-item:first-child{border-radius:var(--card-radius) var(--card-radius) 0 0}
.menu-item:last-child{border-radius:0 0 var(--card-radius) var(--card-radius)}
.menu-item:active{background:var(--bg4)}
.menu-item-left{display:flex;align-items:center;gap:12px}
.menu-item i:last-child{color:var(--text3)}

/* ========================
   SCREEN 9: Favorites
   ======================== */
.fav-tabs{display:flex;gap:0;margin-bottom:16px;background:var(--bg3);border-radius:var(--btn-radius);padding:4px}
.fav-tab{flex:1;text-align:center;padding:10px;font-size:.9rem;font-weight:500;border-radius:10px;color:var(--text3);transition:all .2s;cursor:pointer}
.fav-tab.active{background:var(--grad);color:var(--bg);font-weight:700}
.fav-item{display:flex;align-items:center;justify-content:space-between;background:var(--bg3);border-radius:var(--card-radius);padding:14px 16px;margin-bottom:10px}
.fav-info{display:flex;align-items:center;gap:12px;flex:1;min-width:0}
.fav-info-text{min-width:0}
.fav-info-text .name{font-weight:600;font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fav-info-text .sub{font-size:.75rem;color:var(--text2);margin-top:2px}
.btn-remove{padding:6px 14px;border-radius:8px;font-size:.75rem;background:var(--bg4);color:var(--red);font-weight:700}

/* Tag Free Input */
.tag-input-wrap{display:flex;flex-wrap:wrap;gap:6px;align-items:center;background:var(--bg3);border-radius:var(--btn-radius);padding:8px 12px;min-height:44px}
.tag-input-wrap .tag-item{display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border-radius:16px;font-size:.8rem;background:var(--accent1);color:var(--bg);font-weight:500}
.tag-input-wrap .tag-item .tag-remove{cursor:pointer;font-size:.9rem;opacity:.7}
.tag-input-wrap .tag-item .tag-remove:hover{opacity:1}
.tag-input-wrap input{flex:1;min-width:80px;background:transparent;padding:4px 0;font-size:.85rem;border-radius:0}

/* Area Select */
.area-select{width:100%;padding:10px 14px;font-size:.9rem;border-radius:var(--btn-radius);background:var(--bg3);color:var(--text);appearance:auto;border:1px solid var(--bg4)}

/* Profile Edit */
.profile-edit-avatar{width:100px;height:100px;border-radius:50%;background:var(--grad);margin:0 auto 20px;display:flex;align-items:center;justify-content:center;font-size:2.5rem;position:relative}
.profile-edit-avatar .edit-badge{position:absolute;bottom:0;right:0;width:32px;height:32px;border-radius:50%;background:var(--accent1);display:flex;align-items:center;justify-content:center;border:3px solid var(--bg)}

/* Hima Api Badge */
.cal-cell .hima-badge{position:absolute;top:1px;left:1px;width:20px;height:20px;border-radius:50%;background:rgba(255,71,87,.25);font-size:.65rem;font-weight:700;display:flex;align-items:center;justify-content:center;color:var(--red)}

/* Hima Api FAB */
.fab-hima{position:fixed;bottom:calc(136px + var(--safe-bottom));right:20px;width:46px;height:46px;border-radius:50%;background:var(--bg4);border:2px solid var(--text3);display:flex;align-items:center;justify-content:center;box-shadow:0 4px 16px rgba(0,0,0,.2);z-index:90;transition:all .2s}
.fab-hima:active{transform:scale(.92)}
.fab-hima.active{background:rgba(255,71,87,.3);border-color:var(--red);box-shadow:0 4px 16px rgba(255,71,87,.2)}

/* Hima detail card */
.hima-card{background:var(--bg3);border-radius:var(--card-radius);padding:12px 16px;margin-bottom:8px;border-left:3px solid var(--red)}
.hima-card .hima-time{font-size:.85rem;font-weight:600;color:var(--text);margin-bottom:4px}
.hima-card .hima-genre{font-size:.75rem;color:var(--text2)}

/* ========================
   NOTIFICATION BELL
   ======================== */
.header-right{display:flex;align-items:center;gap:10px}
.notif-bell-wrap{position:relative;display:flex;align-items:center}
.notif-bell-btn{width:36px;height:36px;border-radius:50%;background:var(--bg3);display:flex;align-items:center;justify-content:center;transition:background .2s;flex-shrink:0;position:relative}
.notif-bell-btn:active{background:var(--bg4)}
.notif-bell-btn i{width:18px;height:18px;color:var(--text2)}
.notif-badge{position:absolute;top:-2px;right:-2px;min-width:16px;height:16px;border-radius:8px;background:var(--red);color:#fff;font-size:.55rem;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 3px;border:2px solid var(--bg);animation:badgePop .3s ease}
@keyframes badgePop{from{transform:scale(0)}to{transform:scale(1)}}
.notif-badge.hidden{display:none}

/* Notification Panel */
.notif-panel{position:fixed;top:0;left:0;right:0;bottom:0;z-index:300;pointer-events:none}
.notif-panel-overlay{position:absolute;inset:0;background:rgba(0,0,0,.5);opacity:0;transition:opacity .25s;pointer-events:none}
.notif-panel.open .notif-panel-overlay{opacity:1;pointer-events:auto}
.notif-panel-drawer{position:absolute;top:0;left:0;right:0;background:var(--bg2);border-radius:0 0 24px 24px;box-shadow:0 8px 40px rgba(0,0,0,.5);transform:translateY(-105%);transition:transform .3s cubic-bezier(.4,0,.2,1);max-height:80vh;display:flex;flex-direction:column}
.notif-panel.open .notif-panel-drawer{transform:translateY(0)}
.notif-panel-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid var(--bg4);flex-shrink:0}
.notif-panel-header h2{font-size:1rem;font-weight:700}
.notif-panel-header-right{display:flex;align-items:center;gap:12px}
.notif-read-all{font-size:.75rem;color:var(--accent1);font-weight:600;cursor:pointer}
.notif-close-btn{width:30px;height:30px;border-radius:50%;background:var(--bg4);display:flex;align-items:center;justify-content:center}
.notif-close-btn i{width:14px;height:14px;color:var(--text2)}
.notif-list{overflow-y:auto;flex:1;padding:8px 0}
.notif-item{display:flex;align-items:flex-start;gap:12px;padding:14px 20px;cursor:pointer;transition:background .15s;position:relative}
.notif-item:hover{background:var(--bg3)}
.notif-item.unread{background:rgba(0,229,255,.04)}
.notif-item.unread::before{content:'';position:absolute;left:8px;top:50%;transform:translateY(-50%);width:6px;height:6px;border-radius:50%;background:var(--accent1)}
.notif-item-icon{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1rem;flex-shrink:0}
.notif-item-icon.chat{background:rgba(0,229,255,.15)}
.notif-item-icon.join{background:rgba(6,199,85,.15)}
.notif-item-icon.fav{background:rgba(255,71,87,.15)}
.notif-item-icon.eval{background:rgba(255,217,61,.15)}
.notif-item-icon.event{background:rgba(184,77,255,.15)}
.notif-item-icon.fan-user{background:rgba(255,217,61,.18)}
.notif-item-body{flex:1;min-width:0}
.notif-item-title{font-size:.88rem;font-weight:600;margin-bottom:3px;line-height:1.35}
.notif-item-sub{font-size:.75rem;color:var(--text2);line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.notif-item-time{font-size:.65rem;color:var(--text3);margin-top:4px}
.notif-empty{text-align:center;padding:40px 20px;color:var(--text3);font-size:.9rem}

/* ========================
   LIGHT THEME
   ======================== */
body.light-theme{
  --bg:#f0f2f8;--bg2:#ffffff;--bg3:#e8eaf2;--bg4:#d4d8e8;
  --text:#1a1a30;--text2:#4a4a6a;--text3:#8888aa;
  --accent1:#0096b4;--accent2:#7a20b8;
  --green:#04a044;--red:#cc2233;--yellow:#d49a00;
  --cal-border:rgba(0,0,0,0.08);
}
body.light-theme #screen-login{background:linear-gradient(160deg,#e8f0ff 0%,#f0e8ff 50%,#e8f8ff 100%)}
body.light-theme .footer-nav{box-shadow:0 -2px 10px rgba(0,0,0,.08)}
body.light-theme .event-card{box-shadow:0 1px 6px rgba(0,0,0,.06)}
body.light-theme .msg-self{background:#b7f0c8;color:#1a2e1a}
body.light-theme .msg-self .msg-time{color:rgba(26,46,26,0.55)}
body.light-theme .msg-other{background:#ffffff;border:1px solid #c8cce0;color:#1a1a30}
body.light-theme .msg-other .msg-name{color:#0096b4}
body.light-theme .msg-other .msg-time{color:#8888aa}
body.light-theme .fab{box-shadow:0 4px 20px rgba(0,150,180,.3)}

/* Theme selector cards */
.theme-option{display:flex;flex-direction:column;align-items:center;gap:10px;padding:20px 16px;border-radius:var(--card-radius);border:2px solid var(--bg4);cursor:pointer;transition:all .2s;flex:1;text-align:center}
.theme-option.active{border-color:var(--accent1);background:rgba(0,229,255,.06)}
body.light-theme .theme-option.active{background:rgba(0,150,180,.06)}
.theme-preview-dark{width:52px;height:38px;border-radius:8px;background:#0d0d14;position:relative;overflow:hidden}
.theme-preview-dark::after{content:'';position:absolute;bottom:7px;left:7px;right:7px;height:4px;border-radius:2px;background:linear-gradient(135deg,#00e5ff,#b84dff)}
.theme-preview-light{width:52px;height:38px;border-radius:8px;background:#f0f2f8;border:1.5px solid #d4d8e8;position:relative;overflow:hidden}
.theme-preview-light::after{content:'';position:absolute;bottom:7px;left:7px;right:7px;height:4px;border-radius:2px;background:linear-gradient(135deg,#0096b4,#7a20b8)}

/* ========================
   TUTORIAL ONBOARDING
   ======================== */
.circle-btn.help-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  color: var(--accent1);
  font-weight: 700;
  border: 1px solid rgba(0, 229, 255, 0.15);
  position: relative;
  user-select: none;
}
.circle-btn.help-btn:active {
  transform: scale(0.9);
  background: var(--bg4);
}
body.light-theme .circle-btn.help-btn {
  border-color: rgba(0, 150, 180, 0.2);
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.tutorial-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.tutorial-modal {
  width: 100%;
  max-width: 380px;
  background: rgba(30, 30, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 24px 20px 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
body.light-theme .tutorial-modal {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
.tutorial-overlay.show .tutorial-modal {
  transform: translateY(0);
}
.tutorial-skip {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 0.75rem;
  color: var(--text3);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
  transition: color 0.2s;
}
.tutorial-skip:hover {
  color: var(--accent1);
}
.tutorial-viewport {
  width: 100%;
  overflow: hidden;
  margin-top: 10px;
}
.tutorial-slides {
  display: flex;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  width: 500%;
}
.tutorial-slide {
  width: 20%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 10px;
}
.tutorial-illu {
  width: 140px;
  height: 100px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
body.light-theme .tutorial-illu {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}
.illu-calendar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 70px;
}
.illu-cal-row {
  display: flex;
  gap: 4px;
}
.illu-cal-box {
  width: 16px;
  height: 16px;
  background: var(--bg4);
  border-radius: 4px;
}
.illu-cal-box.active {
  background: var(--accent1);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}
.illu-hima-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.illu-hima-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 12px rgba(255, 71, 87, 0.4);
}
.illu-hima-arrow {
  color: var(--accent1);
  font-weight: bold;
  font-size: 1.1rem;
  animation: bounceX 1s infinite alternate;
}
@keyframes bounceX {
  from { transform: translateX(0); }
  to { transform: translateX(5px); }
}
.illu-cell-demo {
  width: 52px;
  height: 52px;
  background: var(--bg3);
  border: 1px solid var(--accent1);
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.3rem;
}
.illu-cell-demo .badge-demo-blue {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent1);
  color: var(--bg);
  font-size: 0.65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}
body.light-theme .illu-cell-demo .badge-demo-blue {
  color: #fff;
}
.illu-cell-demo .badge-demo-red {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(255, 71, 87, 0.3);
}
.illu-pointer-label {
  position: absolute;
  font-size: 0.5rem;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.illu-pointer-blue {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid var(--accent1);
  color: var(--accent1);
  right: -42px;
  top: -20px;
}
.illu-pointer-red {
  background: rgba(255, 71, 87, 0.15);
  border: 1px solid var(--red);
  color: var(--red);
  left: -42px;
  top: -20px;
}
.illu-fav-demo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.illu-fav-card {
  width: 60px;
  height: 38px;
  background: var(--bg3);
  border-radius: 8px;
  border: 1px solid var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.illu-fav-star {
  color: var(--accent1);
  font-size: 1.1rem;
  animation: spinY 3s infinite linear;
}
@keyframes spinY {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.tutorial-slide h3 {
  font-size: 1rem;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--text);
}
.tutorial-slide p {
  font-size: 0.78rem;
  color: var(--text2);
  line-height: 1.45;
  max-width: 280px;
}

.tutorial-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 0 10px;
}
.tutorial-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
  user-select: none;
}
.tutorial-arrow:active {
  background: var(--bg4);
  transform: scale(0.9);
}
.tutorial-arrow.disabled {
  opacity: 0.3;
  pointer-events: none;
}
.tutorial-dots {
  display: flex;
  gap: 6px;
}
.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg4);
  cursor: pointer;
  transition: all 0.2s;
}
.tutorial-dot.active {
  background: var(--accent1);
  transform: scale(1.2);
  box-shadow: 0 0 6px var(--accent1);
}
.tutorial-footer {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}
body.light-theme .tutorial-footer {
  border-top-color: rgba(0, 0, 0, 0.05);
}
.tutorial-no-show-label {
  font-size: 0.72rem;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.tutorial-no-show-label input {
  accent-color: var(--accent1);
  cursor: pointer;
}
.start-btn {
  margin-top: 10px;
  background: var(--grad);
  color: #0d0d14;
  font-weight: bold;
  border-radius: var(--btn-radius);
  padding: 8px 20px;
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  width: 100%;
  max-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}
.start-btn:active {
  transform: scale(0.96);
}


/* ========================
   HEADER TEMPLATE BUTTON
   ======================== */
.header-template-btn {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 217, 61, 0.2);
  color: var(--yellow);
  border: 1px solid rgba(255, 217, 61, 0.3);
  transition: all 0.15s;
}
.header-template-btn:active {
  transform: scale(0.95);
  background: rgba(255, 217, 61, 0.35);
}
body.light-theme .header-template-btn {
  background: rgba(212, 154, 0, 0.12);
  color: var(--yellow);
  border-color: rgba(212, 154, 0, 0.25);
}
body.light-theme .header-template-btn:active {
  background: rgba(212, 154, 0, 0.25);
}
