/* STL — SIC TRADING LABO. Brand: BLACK base, CYAN primary, GOLD accent, Orbitron for Latin text.
   Tokens follow the existing SIC platform pages (index.html) so FORM / MY PAGE / DC / STL look alike. */
:root {
  --bg: #05090D;
  --bg-2: #080D12;
  --surface: #0B1218;
  --surface-2: #101B23;
  --line: #1F2E38;
  --line-2: #2C404D;
  --text: #F5F8FA;
  --text-2: #A8BAC5;
  --text-3: #6F8491;
  --cyan: #00D5EB;
  --cyan-2: #56EAF5;
  --cyan-soft: rgba(0, 213, 235, .09);
  --gold: #D4AF62;
  --gold-2: #F0D89A;
  --gold-grad: linear-gradient(180deg, #F6E3AE 0%, #D4AF62 52%, #AE8840 100%);
  --gold-text: linear-gradient(180deg, #FBEFC8 0%, #E6C77E 38%, #B48A3E 62%, #E9CF8A 100%);
  --green: #2FD48A;
  --orange: #FF9F43;
  --red: #FF5A6E;
  --grey: #8FA3AF;
  --radius: 14px;
  --gutter: 16px;
  --nav-h: 64px;
  --maxw: 1180px;
  --hdr-bg: rgba(8, 13, 18, .96);
  --nav-bg: #080D12;
  --tile-bg: #0A1116;
  --input-bg: #0B141B;
  --toast-bg: #0F1A21;
  --code-bg: #070C10;
  --on-cyan: #04161A;
  --shadow: 0 12px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* Light mode (STL spec: BLACK is the base; light is a per-device choice in the header / MY PAGE).
   Same brand hues, darkened where they carry text so they stay readable on white. */
:root[data-theme="light"] {
  --bg: #F4F6F8; --bg-2: #EEF2F5; --surface: #FFFFFF; --surface-2: #FAFBFC;
  --line: #DCE3E8; --line-2: #C5D0D8;
  --text: #0E171D; --text-2: #3F5260; --text-3: #6A7C88;
  --cyan: #0A93A6; --cyan-2: #067585; --cyan-soft: rgba(10, 147, 166, .09);
  --gold: #B38A36; --gold-2: #8A6420;
  --gold-text: linear-gradient(180deg, #B8862E 0%, #8A6420 55%, #6E4E15 100%);
  --green: #13894F; --orange: #B8620A; --red: #C8283F; --grey: #5E7280;
  --hdr-bg: rgba(255, 255, 255, .95); --nav-bg: #FFFFFF;
  --tile-bg: #0A1116; --input-bg: #FFFFFF; --toast-bg: #FFFFFF; --code-bg: #F2F5F7; --on-cyan: #FFFFFF;
  --shadow: 0 12px 30px rgba(14, 23, 29, .14);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #F4F6F8; --bg-2: #EEF2F5; --surface: #FFFFFF; --surface-2: #FAFBFC;
    --line: #DCE3E8; --line-2: #C5D0D8;
    --text: #0E171D; --text-2: #3F5260; --text-3: #6A7C88;
    --cyan: #0A93A6; --cyan-2: #067585; --cyan-soft: rgba(10, 147, 166, .09);
    --gold: #B38A36; --gold-2: #8A6420;
    --gold-text: linear-gradient(180deg, #B8862E 0%, #8A6420 55%, #6E4E15 100%);
    --green: #13894F; --orange: #B8620A; --red: #C8283F; --grey: #5E7280;
    --hdr-bg: rgba(255, 255, 255, .95); --nav-bg: #FFFFFF;
    --tile-bg: #0A1116; --input-bg: #FFFFFF; --toast-bg: #FFFFFF; --code-bg: #F2F5F7; --on-cyan: #FFFFFF;
    --shadow: 0 12px 30px rgba(14, 23, 29, .14);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--stl-font, 'Orbitron', 'Noto Sans JP', system-ui, sans-serif); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-2); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.en, .orb { font-family: var(--stl-font); letter-spacing: .06em; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }

/* boot: nothing is painted at first, so a quick page change goes straight from the previous screen
   to this one (the browser keeps the old screen until the new one paints). Only a slow load shows
   the small loader. A big centred logo here looked like the logo zooming in on every page change. */
.stl-boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.boot-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; visibility: hidden; opacity: 0; animation: boot-show .3s ease .9s forwards; }
@keyframes boot-show { to { visibility: visible; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .boot-wait { animation-duration: 0s; } }
.boot-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; }
.boot-text { font-family: var(--stl-font); color: var(--text-2); letter-spacing: .2em; font-size: 12px; }

/* shell */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.hdr { position: sticky; top: 0; z-index: 20; background: var(--hdr-bg); backdrop-filter: blur(8px); }
.hdr::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(212,175,98,.7) 30%, rgba(240,216,154,.9) 50%, rgba(212,175,98,.7) 70%, transparent); }
.hdr-in { max-width: var(--maxw); margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; flex: 1 1 auto; background: none; border: 0; padding: 0; text-align: left; }
.brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; flex: none; }
.brand-t { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--stl-font); font-weight: 800; font-size: 18px; letter-spacing: .1em; background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.15; }
.brand-sub { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-acts { display: flex; gap: 8px; align-items: center; flex: none; }
.who { font-size: 12.5px; color: var(--text-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 10px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; font-family: var(--stl-font); font-size: 12px; font-weight: 600; letter-spacing: .1em; padding: 9px 14px; border-radius: 10px; border: 1px solid transparent; color: var(--text-2); background: none; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--gold-2); border-color: rgba(212,175,98,.55); background: rgba(212,175,98,.1); }

.main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 20px var(--gutter) 40px; }
.bnav { display: none; }

@media (max-width: 760px) {
  .user .tabs { display: none; }
  .user .main { padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
  .bnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--nav-bg); border-top: 1px solid var(--line); }
  .bnav a { background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-family: var(--stl-font); font-size: 9.5px; letter-spacing: .08em; cursor: pointer; position: relative; }
  .bnav a .ic { font-size: 19px; line-height: 1; font-family: var(--stl-font); }
  .bnav a.on { color: var(--gold-2); }
  .bnav a.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--gold-grad); border-radius: 2px; }
  .bnav .dot { position: absolute; top: 9px; right: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-family: var(--stl-font); }
  .brand-name { font-size: 16px; }
  .brand img { width: 38px; height: 38px; }
  .who { display: none; }
}

/* headings */
.kicker { font-family: var(--stl-font); font-size: 11.5px; letter-spacing: .22em; color: var(--cyan); margin: 0 0 4px; }
.h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; line-height: 1.35; }
.lead { color: var(--text-2); margin: 0 0 18px; font-size: 14px; }
.sec { margin: 26px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec h2 { margin: 0; font-family: var(--stl-font); font-size: 14px; letter-spacing: .14em; color: var(--gold-2); font-weight: 700; }
.sec .more { font-size: 12.5px; }
@media (max-width: 760px) { .h1 { font-size: 19px; } }

/* cards / grid */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.k { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); box-shadow: 0 1px 0 rgba(0,0,0,.02); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card.click { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.click:hover { border-color: rgba(0,213,235,.5); transform: translateY(-1px); }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.muted { color: var(--text-3); font-size: 12.5px; }
.empty { color: var(--text-3); padding: 22px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); font-size: 14px; }

/* app tile */
.app { display: flex; gap: 14px; align-items: flex-start; }
.app-ic { width: 64px; height: 64px; border-radius: 16px; flex: none; background: var(--tile-bg) center/contain no-repeat; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.app-ic img { width: 100%; height: 100%; object-fit: contain; }
.app-ic span { font-family: var(--stl-font); font-weight: 800; font-size: 15px; letter-spacing: .06em; background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.app-b { min-width: 0; flex: 1; }
.app-name { font-family: var(--stl-font); font-weight: 700; font-size: 15px; letter-spacing: .04em; margin: 0 0 2px; }
.app-desc { color: var(--text-2); font-size: 13px; margin: 4px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--stl-font); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; line-height: 1.5; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.c-g { color: var(--green); } .c-c { color: var(--cyan-2); } .c-o { color: var(--orange); } .c-r { color: var(--red); } .c-n { color: var(--grey); } .c-y { color: var(--gold-2); }
.bg-g { background: rgba(47,212,138,.1); } .bg-c { background: rgba(0,213,235,.08); } .bg-o { background: rgba(255,159,67,.1); } .bg-r { background: rgba(255,90,110,.1); } .bg-n { background: rgba(143,163,175,.08); } .bg-y { background: rgba(212,175,98,.1); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--cyan); color: var(--text); }
.btn.gold { background: var(--gold-grad); color: #1A1307; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 8px 22px rgba(212,175,98,.2); }
.btn.cyan { background: var(--cyan-soft); color: var(--cyan-2); border-color: rgba(0,213,235,.45); }
.btn.danger { color: var(--red); border-color: rgba(255,90,110,.5); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--cyan); cursor: pointer; padding: 0; font-size: 13px; }

/* forms */
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld label { font-size: 12.5px; color: var(--text-2); font-weight: 700; }
.fld .hint { font-size: 11.5px; color: var(--text-3); }
.fld .err { font-size: 12px; color: var(--red); }
.in, .sel, .area { width: 100%; background: var(--input-bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
.area { min-height: 110px; resize: vertical; }
.in:focus, .sel:focus, .area:focus { border-color: var(--cyan); outline: none; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--cyan); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; min-width: 0; }
legend { font-family: var(--stl-font); font-size: 11.5px; letter-spacing: .16em; color: var(--gold-2); padding: 0 6px; }

/* tables (stack on phones) */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-family: var(--stl-font); font-size: 10.5px; letter-spacing: .12em; color: var(--text-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: rgba(0,213,235,.04); }
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
@media (max-width: 760px) {
  .tbl.stack thead { display: none; }
  .tbl.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .tbl.stack td { display: flex; gap: 10px; border: 0; padding: 4px 8px; }
  .tbl.stack td::before { content: attr(data-k); flex: 0 0 96px; color: var(--text-3); font-size: 11.5px; }
}

/* KPI */
.kpi { padding: 14px 16px; }
.kpi .k { font-family: var(--stl-font); font-size: 10.5px; letter-spacing: .16em; color: var(--text-3); }
.kpi .v { font-family: var(--stl-font); font-weight: 800; font-size: 26px; color: var(--gold-2); line-height: 1.2; margin-top: 4px; }
.kpi .v.c-r { color: var(--red); } .kpi .v.c-o { color: var(--orange); } .kpi .v.c-g { color: var(--green); } .kpi .v.c-c { color: var(--cyan-2); }
.kgroup h3 { font-family: var(--stl-font); font-size: 12px; letter-spacing: .2em; color: var(--cyan); margin: 0 0 10px; }

/* banners / toast / modal */
.ban { border-radius: 12px; padding: 11px 14px; border: 1px solid; font-size: 13.5px; margin: 0 0 12px; display: flex; gap: 10px; align-items: flex-start; }
.ban.info { border-color: rgba(0,213,235,.4); background: rgba(0,213,235,.06); }
.ban.warn { border-color: rgba(255,159,67,.45); background: rgba(255,159,67,.07); }
.ban.err { border-color: rgba(255,90,110,.45); background: rgba(255,90,110,.07); }
.ban.ok { border-color: rgba(47,212,138,.45); background: rgba(47,212,138,.07); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--toast-bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 16px; font-size: 13.5px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
@media (min-width: 761px) { .toast { bottom: 28px; } }
.modal-bg { position: fixed; inset: 0; background: rgba(2,5,8,.72); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 18px; padding: 20px; }
@media (max-width: 760px) { .modal-bg { align-items: flex-end; padding: 0; } .modal { border-radius: 20px 20px 0 0; max-height: 88dvh; } }
pre.json { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12px; overflow: auto; max-height: 360px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

/* login */
.login { max-width: 420px; margin: 6vh auto 0; text-align: center; }
.login img { width: 140px; height: 140px; object-fit: contain; border-radius: 30px; }
.login .card { text-align: left; margin-top: 18px; }

/* community */
.cm { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cm { grid-template-columns: 1fr; } .cm.in-channel .chlist { display: none; } }
.chlist { display: flex; flex-direction: column; gap: 6px; }
.ch { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; width: 100%; }
.ch.child { margin-left: 16px; width: calc(100% - 16px); }
.ch.on { border-color: rgba(0,213,235,.55); background: var(--cyan-soft); }
.ch.locked { opacity: .6; }
.ch .ic { width: 32px; height: 32px; border-radius: 9px; background: var(--tile-bg); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-family: var(--stl-font); font-size: 11px; color: var(--gold-2); flex: none; }
.ch .nm { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread { min-width: 20px; height: 20px; border-radius: 10px; background: var(--cyan); color: var(--on-cyan); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.room { display: flex; flex-direction: column; min-height: 60vh; }
.room-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); }
.feed { flex: 1; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--bg-2); padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow-y: auto; }
@media (max-width: 760px) { .feed { max-height: none; } }
.pinned { border: 1px solid rgba(212,175,98,.4); background: rgba(212,175,98,.06); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.msg .au { color: var(--text); font-weight: 700; font-size: 13px; }
.msg .au.adm { color: var(--gold-2); }
.bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 9px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.msg.mine .bubble { background: rgba(0,213,235,.08); border-color: rgba(0,213,235,.3); }
.msg.imp .bubble { border-color: rgba(212,175,98,.6); }
.msg.del .bubble { color: var(--text-3); font-style: italic; }
.msg.reply { margin-left: 28px; }
.msg img.att { max-width: min(320px, 100%); max-height: 320px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); display: block; margin-top: 6px; cursor: zoom-in; }
.reacts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.react { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 1px 9px; font-size: 13px; cursor: pointer; }
.react.mine { border-color: var(--cyan); background: var(--cyan-soft); }
.msg-acts { display: flex; gap: 10px; }
/* Keep all composer controls above the independently positioned SICbot CTA. */
.compose { position: relative; z-index: 2147483001; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-2); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.compose .area { min-height: 60px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--stl-font); font-size: 10px; letter-spacing: .14em; color: var(--text-3); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.live.on { color: var(--green); } .live.on::before { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* news */
.news { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.news:last-child { border-bottom: 0; }
.news .t { font-weight: 700; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }

.foot { text-align: center; color: var(--text-3); font-size: 11px; padding: 18px var(--gutter) 22px; font-family: var(--stl-font); letter-spacing: .14em; }
@media (max-width: 760px) { .user .foot { display: none; } }

/* theme switch (header) */
.theme-btn { min-width: 40px; padding: 0 10px; font-size: 16px; line-height: 1; }
.theme-btn .lbl { font-size: 11.5px; margin-left: 4px; font-family: var(--stl-font); }
@media (max-width: 760px) { .theme-btn .lbl { display: none; } }

/* SIC original emoji inline, reactions and stamps */
img.cemoji { width: 1.45em; height: 1.45em; object-fit: contain; vertical-align: -0.35em; margin: 0 1px; }
.react img.cemoji { width: 18px; height: 18px; vertical-align: -4px; }
.msg.stamp .bubble { background: none; border: 0; padding: 0; }
img.stamp { width: 150px; height: 150px; object-fit: contain; display: block; }
@media (max-width: 760px) { img.stamp { width: 120px; height: 120px; } }

/* emoji palette under the composer */
.palette { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.palette .ptabs { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.palette .ptabs::-webkit-scrollbar { display: none; }
.palette .ptab { flex: none; border: 1px solid transparent; background: none; border-radius: 8px; padding: 5px 10px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.palette .ptab.on { border-color: rgba(212,175,98,.55); color: var(--gold-2); background: rgba(212,175,98,.1); }
.palette .pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; padding: 8px; max-height: 210px; overflow-y: auto; }
.palette .pgrid.stamps { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.palette .pe { border: 0; background: none; border-radius: 8px; font-size: 24px; line-height: 1; padding: 6px 0; cursor: pointer; }
.palette .pe:hover, .palette .pe:focus-visible { background: var(--cyan-soft); outline: none; }
.palette .pe img { width: 28px; height: 28px; object-fit: contain; }
.palette .pgrid.stamps .pe img { width: 72px; height: 72px; }
.palette .pe[disabled] { opacity: .35; cursor: not-allowed; }
.palette .pempty { grid-column: 1 / -1; color: var(--text-3); font-size: 13px; padding: 12px 4px; }
.palette .psec { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-3); padding: 4px 2px 0; }

/* admin: emoji / stamp list */
.emoji-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.emoji-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 6px; justify-items: start; background: var(--surface); }
.emoji-item img { width: 56px; height: 56px; object-fit: contain; }
.emoji-item.hidden { opacity: .5; }
.rx-preview { display: flex; gap: 6px; flex-wrap: wrap; font-size: 22px; align-items: center; min-height: 34px; }

/* Attachments (ADMIN picker / member file list) */
.att-pick { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.att-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; overflow-wrap: anywhere; }
.att-files { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.att-files .btn { max-width: 100%; white-space: normal; text-align: left; overflow-wrap: anywhere; }

/* ---- STL CENTRAL doors (MY PAGE / SIC FORM / DOWNLOAD CENTER / COMMUNITY) ---- */
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
@media (max-width: 760px) { .doors { grid-template-columns: 1fr; } }
.door { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding: 22px 56px 22px 22px; border-radius: 18px;
  color: var(--text); background: var(--door-bg); border: 2px solid var(--door-bd); box-shadow: 0 10px 28px rgba(0,0,0,.25); text-decoration: none; }
.door:hover, .door:focus-visible { transform: translateY(-1px); color: inherit; }
.door:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.door.cy, .door.cy2 { --door-bd: var(--cyan); --door-bg: linear-gradient(160deg, var(--cyan-soft), transparent 70%); }
.door.gd, .door.gd2, .door.gd3 { --door-bd: var(--gold); --door-bg: linear-gradient(160deg, rgba(212,175,98,.14), transparent 70%); }
.door-en { font-family: var(--stl-font); font-weight: 800; font-size: 24px; letter-spacing: .06em; line-height: 1.15; }
.door.cy .door-en, .door.cy2 .door-en { color: var(--cyan-2); }
.door.gd .door-en, .door.gd2 .door-en, .door.gd3 .door-en { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.door-ja { font-weight: 700; font-size: 20px; }
.door-d { font-size: 15px; opacity: .85; line-height: 1.6; }
.door-n { font-size: 14px; font-weight: 700; color: var(--gold-2); }
.door-go { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 40px; line-height: 1; opacity: .8; }

/* STL ADMIN inside SIC ADMIN: no own header / tabs (SIC ADMIN's menu is used); SIC ADMIN's type scale. */
.shell.embed { min-height: 100vh; }
.shell.embed .main { max-width: 1240px; padding: 28px 28px 48px; }
.shell.embed .kicker { font-family: 'Orbitron', serif; font-size: 11px; letter-spacing: .3em; color: var(--gold); display: flex; align-items: center; gap: 12px; }
.shell.embed .kicker::before { content: ''; width: 30px; height: 1px; background: var(--gold); }
.shell.embed .h1 { font-size: 26px; margin-bottom: 18px; }
.shell.embed .sec h2 { font-family: var(--stl-font); font-size: 15px; letter-spacing: .04em; }
@media (max-width: 700px) { .shell.embed .main { padding: 20px 16px 40px; } .shell.embed .h1 { font-size: 22px; } }
.grid.k4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
a.kpi { display: block; color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--gold); }
.kpi.t-g, .kpi.t-o, .kpi.t-r, .kpi { border-top: 2px solid var(--gold); }
.kpi.t-g { border-top-color: var(--green); } .kpi.t-o { border-top-color: var(--orange); } .kpi.t-r { border-top-color: var(--red); }
.grid.k4 .kpi .k { font-family: var(--stl-font); font-size: 14px; letter-spacing: 0; color: var(--text-2); }
.grid.k4 .kpi .v { font-size: 30px; margin: 6px 0 4px; }
.kpi .s { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
@media (max-width: 700px) { .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .grid.k4 .kpi .v { font-size: 24px; } }

/* ---- プッシュ通知のスライドスイッチ（MY PAGE › 設定） ---- */
.swrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.10)); }
.swrow:first-child { padding-top: 2px; }
.swrow:last-child { border-bottom: 0; padding-bottom: 2px; }
.swtxt { min-width: 0; }
.swtxt b { display: block; font-size: 14px; font-weight: 600; color: var(--txt, #e8eaed); }
.swtxt small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.5; color: var(--muted, #9aa0a6); }
.sw { position: relative; flex: 0 0 auto; width: 52px; height: 30px; border-radius: 999px; border: 1px solid var(--line2, rgba(255,255,255,.18)); background: #191b1d; cursor: pointer; padding: 0; transition: background .18s ease, border-color .18s ease; }
.sw i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #6b7280; transition: transform .18s cubic-bezier(.4,0,.2,1), background .18s ease; }
.sw[aria-checked="true"] { background: linear-gradient(180deg, #E7C878, #C9A24B); border-color: #D4AF62; }
.sw[aria-checked="true"] i { transform: translateX(22px); background: #10110f; }
.sw[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 480px) { .swtxt b { font-size: 13.5px; } }

/* Shared redesign: preserve state colours and the user-selected light theme. */
.hdr { padding-top: env(safe-area-inset-top); }
.tab, .btn, .brand, .bnav a { min-height: var(--stl-touch); }
.tab { display: inline-flex; align-items: center; justify-content: center; }
.bnav a { text-decoration: none; min-width: 0; text-align: center; line-height: 1.45; padding: 4px 2px; }
.card p, .body-text, .fld label, .hint, .lead { font-size: var(--stl-font-body); line-height: var(--stl-line-height); }
.stl-utilities a { color: var(--text-2); }
@media (max-width:760px) {
  .bnav a { font-size: 8px; letter-spacing: .015em; }
  .user .hdr-in { flex-wrap: wrap; }
  .user .hdr-acts { gap: 4px; }
  .user .hdr-acts .btn { padding: 8px; font-size: 12px; }
  .user .stl-utilities { gap: 0 12px; padding-bottom: 0; }
}

/* Readable Japanese labels/body; the tiny English nav captions keep their own scale. */
.muted, .app-desc, .badge, .btn, .btn.sm, .link, .chk, .ban, .toast, .pinned,
.tbl, .tbl th, .tbl.stack td::before, .msg .meta, .msg .au, .palette .pempty,
.palette .psec, .att-chip, .fld .err, .swtxt small { font-size: var(--stl-font-body); line-height: var(--stl-line-height); }
.in, .sel, .area { font-size: 16px; min-height: var(--stl-touch); }
.link, .react, .palette .ptab { min-height: var(--stl-touch); }
.muted, .fld .hint, .tbl th, .tbl.stack td::before, .msg .meta { color: var(--text-2); }

@media (max-width:760px) { .bnav a { font-size: 10px; } }

/* Unified USER / ADMIN card treatment for browser, installed PWA and Android WebView.
   Preserve existing card layout; only normalize the gold frame and focus affordance. */
.shell .card, .shell.embed .card {
  border: 1px solid rgba(212, 175, 98, .65);
  box-shadow: inset 0 0 0 1px rgba(240, 216, 154, .10), 0 8px 24px rgba(0, 0, 0, .20);
}
.shell .card.click:hover, .shell.embed .card.click:hover,
.shell .card.click:focus-visible, .shell.embed .card.click:focus-visible {
  border-color: var(--gold-2);
  outline: 2px solid rgba(212, 175, 98, .35);
  outline-offset: 2px;
}

/* All primary USER entry cards share ADMIN's gold outline. */
.doors .door { border-color: var(--gold); }

/* Phones: the member header scrolls away with the page (the bottom navigation stays), and is
   one compact row plus one scrollable link row. Touch targets stay 44px. */
@media (max-width:760px) {
  .user .hdr { position: relative; }
  .user .hdr-in { flex-wrap: nowrap; padding: 8px 12px; gap: 8px; }
  .user .brand img { width: 36px; height: 36px; }
  .user .brand-name { font-size: 15px; white-space: nowrap; }
  .user .brand-sub { display: none; }
  .user .stl-utilities { padding: 0 12px 2px; gap: 0 14px; }
}

/* STL HOME redesign (owner instruction 2026-10-13): icon cards and quick links. */
.door-ic { font-size: 22px; line-height: 1; opacity: .9; }
.door.cy .door-ic, .door.cy2 .door-ic { color: var(--cyan-2); }
.door.gd .door-ic, .door.gd2 .door-ic { color: var(--gold-2); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.quick-a { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid rgba(212,175,98,.55); background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), var(--surface, #0D151C); color: var(--text); text-decoration: none; }
.quick-a:hover, .quick-a:focus-visible { border-color: var(--gold-2); color: var(--text); }
.quick-en { font-family: var(--stl-font); font-weight: 700; font-size: 12px; letter-spacing: .12em; color: var(--gold-2); }
.quick-ja { font-size: 14px; font-weight: 700; }
@media (max-width: 760px) {
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
  .doors .door { min-height: 128px; padding: 14px 14px 16px; gap: 4px; border-radius: 16px; }
  .door-go, .door-d { display: none; }
  .door-en { font-size: 15px; letter-spacing: .04em; }
  .door-ja { font-size: 15px; }
  .door-n { font-size: 12.5px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick-a { min-height: 60px; padding: 10px 12px; }
}

/* Breadcrumb trail and hamburger drawer (shared styles in common.css). */
.crumbs-bar { width: 100%; max-width: var(--maxw); margin: 12px auto -8px; padding: 0 var(--gutter); }
.hdr-acts .stl-burger { margin-left: 2px; }
button.stl-drawer-item { width: 100%; border: 0; background: none; font: inherit; text-align: left; }
@media (max-width: 699px) { .user .stl-utilities { display: none; } }

/* STL HOME carousels (MY APPS / NEWS); shared carousel styles live in common.css. */
.car-sec { margin-top: 26px; }
.car-sec .stl-carousel-t { font-family: var(--stl-font); }
.car-sec .stl-carousel-nav { align-items: center; }
.car-sec .stl-carousel-nav > a { margin-right: 6px; font-size: 13px; }
.car-sec .stl-prods { gap: 14px; }
.news-card { display: flex; flex-direction: column; gap: 8px; cursor: pointer; min-height: 132px; }
.news-card .t { font-weight: 700; line-height: 1.6; flex: 1; }
.news-card .news-more { font-size: 13px; color: var(--cyan, #56EAF5); align-self: flex-end; }
.news-card:hover { border-color: rgba(212,175,98,.6); }
@media (max-width: 699px) { .tabs.stl-has-pick { display: none; } }
/* Phones: the header keeps logo, title and the menu button (theme and logout are in the menu),
   so "STL CENTRAL" is never cut off. */
@media (max-width: 699px) { .user .hdr-acts .btn { display: none; } }

/* ---- STL HOME artwork doors (owner's artwork, text stays real HTML) ---------------------------- */
.doors .door.has-art { display: block; min-height: 0; padding: 0; aspect-ratio: 1.6; overflow: hidden; border: 1.5px solid var(--gold);
  border-radius: 18px; background: #05090D; color: #F5F8FA; box-shadow: 0 10px 28px rgba(0,0,0,.45), 0 0 0 1px rgba(240,216,154,.08) inset; }
.door.has-art:hover, .door.has-art:focus-visible { box-shadow: 0 12px 30px rgba(0,0,0,.5), 0 0 22px rgba(212,175,98,.28); }
.door-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.door.has-art .door-ic { display: none; }
.door-t { position: absolute; left: 50%; right: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.door.has-art .door-en { font-size: clamp(18px, 2.4vw, 28px); font-weight: 800; letter-spacing: .04em; line-height: 1.1;
  background: linear-gradient(180deg, #FBEFC8 0%, #E6C77E 40%, #B48A3E 64%, #E9CF8A 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.door-line { display: block; height: 2px; width: 100%; max-width: 220px; background: linear-gradient(90deg, rgba(212,175,98,.9), #2F8BFF 70%, transparent); border-radius: 2px; }
.door.has-art .door-ja { font-size: 17px; font-weight: 700; color: #F5F8FA; }
.door.has-art .door-d { font-size: 13px; color: #A8BAC5; opacity: 1; line-height: 1.5; }
.door.has-art .door-n { position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: #1A1307; background: linear-gradient(180deg, #F6E3AE, #D4AF62); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
/* Phones: two cards per row; the artwork fills the card and the words sit on a dark band at the bottom. */
@media (max-width: 699px) {
  .doors .door.has-art { aspect-ratio: 1.2; border-radius: 16px; }
  .door-art { object-position: 18% 40%; }
  .door-t { left: 0; right: 0; top: auto; bottom: 0; transform: none; gap: 3px; padding: 22px 12px 10px;
    background: linear-gradient(180deg, rgba(5,9,13,0) 0%, rgba(5,9,13,.82) 42%, rgba(5,9,13,.95) 100%); }
  .door.has-art .door-en { font-size: 13px; letter-spacing: .03em; }
  .door-line { max-width: 70%; height: 1.5px; }
  .door.has-art .door-ja { font-size: 13.5px; }
  .door.has-art .door-d { display: none; }
  .door.has-art .door-n { top: 8px; right: 8px; font-size: 11px; padding: 2px 8px; }
  /* Secondary links: one slim row of four under the main cards. */
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  .quick-a { min-height: 52px; padding: 8px 6px; align-items: center; text-align: center; border-radius: 12px; }
  .quick-en { font-size: 9.5px; letter-spacing: .08em; }
  .quick-ja { font-size: 13px; }
}
/* Bottom navigation: solid (nothing shows through) and styled like the MY PAGE / FORM / DC one. */
@media (max-width: 760px) {
  .bnav a { color: var(--text-2); gap: 4px; font-weight: 700; }
  .bnav a.on { background: rgba(212,175,98,.1); color: var(--gold-2); }
  .bnav a.on::before { left: 0; right: 0; }
  .user .h1 { font-size: 18px; }
  .user .lead { margin-bottom: 14px; }
  .user .kicker { font-size: 10.5px; letter-spacing: .18em; }
}
@media (max-width: 760px) { :root { --nav-h: 76px; } }


/* Wide screens (PC / tablet): the same bottom menu as on phones (owner request 2026-10-14), its four
   items kept to a phone-like width in the middle. The top tab row that repeated them is not shown. */
@media (min-width: 761px) {
  .user .tabs { display: none; }
  .user .main { padding-bottom: calc(var(--stl-nav-height, var(--nav-h)) + 28px); }
  .user .foot { padding-bottom: calc(var(--stl-nav-height, var(--nav-h)) + 22px); }
  .bnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--stl-nav-height, var(--nav-h));
    padding: 0 max(var(--gutter), calc((100% - 720px) / 2)); background: var(--nav-bg); border-top: 1px solid var(--line); }
  .bnav a { background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-2);
    font-family: var(--stl-font); font-size: 11px; font-weight: 700; letter-spacing: .08em; cursor: pointer; position: relative; }
  .bnav a .ic { font-size: 19px; line-height: 1; font-family: var(--stl-font); }
  .bnav a.on { background: rgba(212,175,98,.1); color: var(--gold-2); }
  .bnav a.on::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gold-grad); border-radius: 2px; }
  .bnav .dot { position: absolute; top: 9px; right: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px; font-family: var(--stl-font); }
}
/* STL ADMIN 分類タグ (2026-11-15) */
.tag-axis{display:grid;gap:12px;margin-bottom:12px}
.tag-chips{display:flex;flex-wrap:wrap;gap:8px}
.tag-edit{display:inline-flex;align-items:center;gap:4px}
.tag-edit .tag-name{width:10em;min-width:0}
.tag-item{display:grid;gap:8px;margin-bottom:10px}
.tag-item-head{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline}
.tag-line{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.tag-axis-name{flex:0 0 100%;font-size:13px;font-weight:700;color:#ffad42}
.tag-toggle{min-height:40px;padding:6px 14px;border-radius:999px;border:1px solid #3c7ea6;background:#08182b;color:#fff;font-size:14px;cursor:pointer}
.tag-toggle.on{background:#ffad42;border-color:#ffad42;color:#1a1003;font-weight:700}
.tag-save{position:sticky;bottom:0;z-index:5;display:none;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;margin-top:16px;padding:12px 14px;border:1px solid #ffad42;border-radius:14px;background:#120c03;color:#fff}
.tag-save.on{display:flex}
