:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f7f7fb;
  background: #090909;
  --accent: #c66b66;
  --accent-strong: #ad514c;
  --panel: #111112;
  --panel-raised: #19191a;
  --border: #303031;
  --muted: #a3a09e;
  --success: #54d9a2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #090909; }
body { min-height: 100vh; margin: 0; background: radial-gradient(ellipse at 85% 30%, #32191b33, transparent 50%), #090909; }
button, a, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.portal-header {
  position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 clamp(20px, 4vw, 52px); border-bottom: 1px solid #20232d;
  background: rgba(9, 9, 9, .92); backdrop-filter: blur(18px);
}
.brand { color: #fff; text-decoration: none; font-weight: 820; display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #713c3b; border-radius: 3px; color: #dfb5a7; background: #241314; font-family: serif; font-size: 24px; }
.brand small { color: #898e9e; font-size: 11px; font-weight: 700; padding: 4px 7px; border: 1px solid #303442; border-radius: 6px; }
.header-actions, .user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip { background: #171a23; border: 1px solid #2a2e3a; padding: 5px 10px 5px 5px; border-radius: 999px; color: #dfe1e9; font-size: 12px; font-weight: 700; }
.user-chip img { width: 27px; height: 27px; border-radius: 50%; background: #302b49; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: clamp(36px, 6vw, 72px) 0 100px; }
.eyebrow { margin: 0; color: #a99cff; font-size: 10px; font-weight: 850; letter-spacing: .18em; }
.status { color: var(--muted); font-size: 12px; }

.primary, .secondary, .quiet, .back-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px;
  border-radius: 10px; padding: 0 17px; border: 0; text-decoration: none; font-weight: 760; cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}
.primary { color: #171313; background: #e1d6c8; box-shadow: none; }
.primary:hover { background: #f1e8dc; transform: translateY(-1px); }
.secondary, .quiet { color: #e4e5ec; border: 1px solid #373b48; background: #20232d; }
.secondary:hover, .quiet:hover { background: #292d39; border-color: #4a4f60; }
.compact { min-height: 36px; padding: 0 13px; font-size: 12px; }
.primary:disabled { opacity: .5; cursor: wait; transform: none; }

.hero {
  position: relative; min-height: 640px; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 24px;
  padding: clamp(30px, 5vw, 64px) clamp(28px, 5vw, 68px) 110px; border: 1px solid #302829; border-radius: 4px;
  background: linear-gradient(110deg, #131212, #0c0c0d 65%); overflow: hidden;
  box-shadow: 0 30px 100px #0005;
}
.hero-copy { position: relative; z-index: 1; }
.hero-copy h1 { margin: 28px 0 25px; color: #eae3d9; font-size: clamp(46px, 5.2vw, 70px); font-weight: 600; line-height: 1.05; letter-spacing: -.055em; }
.hero-copy h1 span { color: #a8a19a; }
.hero-copy .eyebrow { display: flex; align-items: center; gap: 12px; color: #ca8d83; font-size: 10px; letter-spacing: .2em; }
.eyebrow-line { width: 24px; height: 1px; background: #bb635d; }
.hero-copy > p:not(.eyebrow):not(.status) { max-width: 570px; margin: 0 0 28px; color: #aaaebb; line-height: 1.75; font-size: 15px; }
.login-button { min-height: 50px; padding: 0 22px; border-radius: 3px; gap: 30px; }
.login-button span { font-size: 19px; }
.legal-consent { max-width: 490px; margin: 13px 0 0 !important; color: #777c8d !important; font-size: 10px !important; line-height: 1.55 !important; }
.legal-consent a, .portal-footer a { color: #c1a799; text-decoration: none; }
.legal-consent a:hover, .portal-footer a:hover { color: #ebd4c5; text-decoration: underline; }
.kami-art { position: relative; min-width: 0; }
.kami-eclipse { display: block; width: 125%; max-width: none; margin-left: -12%; }
.art-caption { position: absolute; bottom: 3%; width: 100%; text-align: center; color: #92776f; font-size: 11px; letter-spacing: .32em; }
.art-side { position: absolute; right: -28px; top: 30%; writing-mode: vertical-rl; color: #785953; font-size: 8px; letter-spacing: .3em; }
.hero-capabilities { position: absolute; bottom: 0; left: 0; width: 100%; display: flex; align-items: center; gap: 32px; border-top: 1px solid #2e2525; padding: 24px clamp(28px, 5vw, 68px); color: #9d655e; font-size: 10px; }
.hero-capabilities strong { margin-left: 10px; color: #bcb4aa; font-weight: 500; font-size: 12px; }
.hero-capabilities .hero-access { margin-left: auto; color: #8f8983; font-size: 10px; }
.footer-separator { padding: 0 12px; color: #764b45; }
button:focus-visible, a:focus-visible { outline: 2px solid #e1bba9; outline-offset: 5px; }
.settings-tab.active { border-color: #75413c; background: #2b1d1c; }
.settings-tab span, legend span, .eyebrow { color: #c8867a; }
.config-icon { background: #46302a; }
.hero-panel { border: 1px solid #3b3e4e; border-radius: 19px; padding: 20px; background: #12141c; box-shadow: 0 24px 65px #0006; transform: rotate(1deg); }
.mock-top { display: flex; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid #252936; }
.mock-top span { width: 7px; height: 7px; border-radius: 50%; background: #44495a; }
.mock-server { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 22px 0; }
.mock-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #8f7df5, #5e51cb); font-weight: 900; }
.mock-server strong, .mock-server small { display: block; }
.mock-server small { margin-top: 4px; color: #818697; font-size: 10px; }
.mock-server b { color: var(--success); font-size: 9px; letter-spacing: .12em; }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mock-grid span { padding: 15px; border: 1px solid #292d3a; border-radius: 10px; color: #bdc0ca; background: #181b24; font-size: 11px; }
.mock-bar { height: 9px; margin-top: 18px; border-radius: 9px; background: #262936; overflow: hidden; }
.mock-bar i { display: block; width: 74%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8e7cf5, #5ad4a4); }

.dashboard-home { animation: rise .3s ease; }
.dashboard-title { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 14px 0 34px; border-bottom: 1px solid #222630; }
.dashboard-title h1 { margin: 10px 0 8px; font-size: clamp(32px, 5vw, 48px); letter-spacing: -.045em; }
.dashboard-title > div > p:last-child { color: var(--muted); margin: 0; font-size: 13px; }
.access-badge { display: flex; align-items: center; gap: 11px; min-width: 250px; padding: 13px 16px; border: 1px solid #2a3f38; border-radius: 13px; background: #14221f; }
.access-badge > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #254d40; color: var(--success); }
.access-badge strong, .access-badge small { display: block; }
.access-badge strong { font-size: 12px; }.access-badge small { color: #7d9c91; margin-top: 3px; font-size: 10px; }

.server-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.server-grid article { position: relative; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(145deg, #181b24, #13161e); transition: transform .18s ease, border-color .18s ease; }
.server-grid article:hover { transform: translateY(-2px); border-color: #49435f; }
.server-identity { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.server-identity img, .server-identity > span { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: #302b49; object-fit: cover; font-weight: 850; }
.server-identity h3 { margin: 0 0 5px; font-size: 15px; }.server-identity p { margin: 0; color: #858a9a; font-size: 11px; }
.install-actions { display: flex; flex-wrap: wrap; gap: 8px; }.install-actions a { min-height: 38px; font-size: 11px; }
.install-help { color: #767b8d; font-size: 10px; line-height: 1.55; margin: 12px 0 0; }

.configuration { max-width: 1040px; margin: 0 auto; animation: rise .3s ease; }
.config-heading { display: grid; grid-template-columns: 42px 58px 1fr auto; gap: 16px; align-items: center; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid #242833; }
.back-button { width: 42px; min-height: 42px; padding: 0; color: #d9dbe4; background: #1d202a; border: 1px solid #333744; font-size: 19px; }
.config-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; overflow: hidden; background: linear-gradient(145deg, #8f7df5, #5e51cb); font-size: 20px; font-weight: 850; }
.config-icon img { width: 100%; height: 100%; object-fit: cover; }.config-icon span { grid-area: 1/1; }
.config-name h1 { margin: 6px 0 4px; font-size: 25px; letter-spacing: -.035em; }.config-name > p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.save-state { padding: 7px 10px; border-radius: 999px; color: #9fa4b5; background: #1a1d26; border: 1px solid #2b2f3b; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }

.settings-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-bottom: 24px;
  padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: #11141c;
}
.settings-tab {
  min-height: 48px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px;
  color: #8e93a3; background: transparent; font-size: 11px; font-weight: 750; cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.settings-tab span { margin-right: 6px; color: #8f7df5; }
.settings-tab:hover { color: #e9eaf0; background: #191c25; }
.settings-tab.active { color: #fff; border-color: #4b446e; background: linear-gradient(135deg, #29243e, #211e32); box-shadow: 0 5px 18px #0003; }
.settings-panel { min-height: 480px; animation: rise .22s ease; }
.panel-intro { margin-bottom: 22px; }
.panel-intro h2 { margin: 7px 0 5px; font-size: 21px; letter-spacing: -.025em; }
.panel-intro > p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
fieldset { min-width: 0; margin: 0; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(145deg, var(--panel-raised), var(--panel)); }
.wide-card { grid-column: 1 / -1; }
legend { display: flex; align-items: center; gap: 9px; padding: 0 8px; color: #f1f2f7; font-size: 14px; font-weight: 800; }
legend span { color: #a99cff; }.field-note { margin: 2px 0 18px; color: #7f8494; font-size: 11px; line-height: 1.55; }
label { display: grid; gap: 7px; margin: 14px 0; color: #aeb2c1; font-size: 11px; font-weight: 650; }
.switch { display: flex; align-items: center; gap: 11px; min-height: 36px; color: #e5e6ed; }
.switch > span { display: block; font-size: 12px; }.switch small { display: block; margin-top: 3px; color: #777d8e; font-size: 9px; font-weight: 500; }
input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
input:not([type="checkbox"]), select, textarea { width: 100%; border: 1px solid #363a48; border-radius: 9px; outline: none; background: #10121a; color: #f3f3f7; padding: 10px 11px; font-size: 12px; transition: border-color .15s ease, box-shadow .15s ease; }
input:not([type="checkbox"]):focus, select:focus, textarea:focus { border-color: #7568d1; box-shadow: 0 0 0 3px #7869e321; }
textarea { resize: vertical; line-height: 1.5; }fieldset > small { color: #777d8e; font-size: 9px; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.builder-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 14px; }
.choice-heading, .publish-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; }
.choice-heading strong, .choice-heading small { display: block; }.choice-heading strong { font-size: 12px; }.choice-heading small { margin-top: 4px; color: #777d8e; font-size: 9px; }
.role-choices { display: grid; gap: 8px; margin-top: 12px; }
.automation-rules { display: grid; gap: 16px; margin-top: 16px; }
.automation-rules fieldset > button { margin-top: 14px; }
.card-kind { display:flex; gap:8px; margin-bottom:14px }
.greeting-preview { position:relative; width:100%; aspect-ratio:3/1; min-height:180px; overflow:hidden; border:1px solid #62627e; border-radius:14px; background:linear-gradient(90deg,#29224c,#7553ae); touch-action:none }
.greeting-preview::after { content:''; position:absolute; width:37%; aspect-ratio:1; border-radius:50%; right:-10%; top:-45%; background:#ffffff0f; pointer-events:none }
.greeting-background { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none }
.greeting-avatar { position:absolute; width:15.4%; aspect-ratio:1; display:grid; place-items:center; transform:translate(-50%,-50%); border:3px solid #ffffffaa; border-radius:50%; background:#ffffff33; color:#fff; font-size:38px; cursor:grab; user-select:none; z-index:2 }
.greeting-text { position:absolute; max-width:65%; transform:translateY(-50%); color:#fff; font-size:clamp(16px,3vw,38px); line-height:1.1; font-weight:800; text-shadow:0 2px 7px #0005; cursor:grab; user-select:none; z-index:2 }
.greeting-fields { margin-top:16px }
.greeting-fields input[type="color"] { height:42px; padding:3px }
.progress-leaders { display:grid; gap:7px; margin-top:14px; color:#adb3c4; font-size:12px }
.progress-leaders > div { display:flex; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:#181b24 }
.progress-actions { display:flex; gap:8px; flex-wrap:wrap }
.role-choice { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 8px; align-items: center; }
.remove-choice { width: 34px; height: 34px; border: 1px solid #4b3945; border-radius: 8px; background: #2a1c23; color: #eaa5b6; font-size: 18px; cursor: pointer; }
.remove-choice:hover { border-color: #895268; background: #39232d; }
.panel-preview { margin-top: 18px; padding: 17px; border: 1px solid #343847; border-radius: 12px; background: #10131b; }
.panel-preview > small { color: #73798a; font-size: 8px; font-weight: 850; letter-spacing: .15em; }.panel-preview > p { margin: 9px 0 12px; color: #d8dae2; font-size: 12px; }
.panel-preview-buttons { display: flex; flex-wrap: wrap; gap: 7px; }.panel-preview-buttons span { padding: 8px 12px; border-radius: 7px; background: #4b4f59; color: #fff; font-size: 10px; font-weight: 700; }.panel-preview-buttons em { color: #6f7484; font-size: 10px; }
.publish-row { padding-top: 16px; border-top: 1px solid #292d3a; }.publish-row p { margin: 0; color: #858a9a; font-size: 10px; }.publish-row a { color: #aaa0f5; }

.save-bar { position: sticky; z-index: 10; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 22px; padding: 14px 15px 14px 18px; border: 1px solid #363948; border-radius: 14px; background: rgba(20, 23, 31, .96); box-shadow: 0 18px 55px #0007; backdrop-filter: blur(18px); }
.save-bar strong { display: block; font-size: 12px; }.save-bar p { margin: 4px 0 0; color: #858a9a; font-size: 10px; }

.portal-footer { width: min(1180px, calc(100% - 40px)); min-height: 70px; margin: 0 auto; padding: 20px 0 28px; border-top: 1px solid #20232d; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #6f7484; font-size: 10px; }
.portal-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }.hero-panel { display: none; }
  .kami-art { position: absolute; width: 430px; right: -140px; top: 30px; opacity: .24; pointer-events: none; }.art-caption, .art-side { display: none; }
  .hero-copy { max-width: 550px; }.hero-capabilities { gap: 22px; }.hero-capabilities .hero-access { display: none; }
  .server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.settings-grid { grid-template-columns: 1fr; }
  .settings-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }.settings-panel { min-height: 0; }
}
@media (max-width: 600px) {
  main { width: min(100% - 24px, 1180px); padding-top: 24px; }.portal-header { padding: 0 14px; }.brand small, .user-chip span { display: none; }
  .hero { padding: 38px 25px 100px; border-radius: 4px; }.hero-copy h1 { font-size: 48px; }.hero-capabilities { padding: 22px 25px; gap: 15px; }.hero-capabilities strong { margin-left: 5px; font-size: 10px; }
  .dashboard-title { display: block; }.access-badge { margin-top: 22px; min-width: 0; }.server-grid { grid-template-columns: 1fr; }
  .config-heading { grid-template-columns: 42px 48px 1fr; }.config-icon { width: 48px; height: 48px; border-radius: 13px; }.save-state { display: none; }
  .settings-tabs { display: flex; overflow-x: auto; padding: 5px; scrollbar-width: none; }.settings-tabs::-webkit-scrollbar { display: none; }.settings-tab { flex: 0 0 auto; white-space: nowrap; min-height: 42px; }
  .builder-grid, .role-choice { grid-template-columns: 1fr; }.remove-choice { width: 100%; }.choice-heading, .publish-row { align-items: stretch; flex-direction: column; }.choice-heading button, .publish-row button { width: 100%; }
  fieldset { padding: 19px; }.save-bar { bottom: 8px; }.save-bar strong { display: none; }
  .portal-footer { width: min(100% - 24px, 1180px); align-items: flex-start; flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
