:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090d12;
  color: #e9f2f4;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(29, 164, 167, .14), transparent 35rem),
    radial-gradient(circle at 90% 90%, rgba(37, 99, 235, .09), transparent 32rem),
    #090d12;
}

.shell { width: min(920px, 100%); min-height: 100vh; margin: auto; display: grid; grid-template-rows: auto 1fr auto auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 24px clamp(18px, 4vw, 36px); border-bottom: 1px solid #1d2832; }
.brand { display: flex; align-items: center; gap: 12px; letter-spacing: .18em; }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 14px; }
.brand small { color: #6d7f8d; font-size: 9px; letter-spacing: .26em; }
.mark { width: 28px; height: 28px; border: 1px solid #38d5d8; border-radius: 50%; box-shadow: 0 0 25px rgba(56, 213, 216, .35), inset 0 0 12px rgba(56, 213, 216, .2); position: relative; }
.mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #68f4ef; box-shadow: 0 0 12px #68f4ef; }
.status { color: #8395a2; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.status span:first-child { width: 7px; height: 7px; border-radius: 50%; background: #d6a744; box-shadow: 0 0 8px currentColor; }
.status.online span:first-child { background: #39d98a; }
.status.offline span:first-child { background: #ef6b73; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.logout, .utility { padding: 6px 9px; border: 1px solid #2a3a46; border-radius: 7px; background: transparent; color: #81939f; font-size: 10px; cursor: pointer; }
.logout:hover, .utility:hover { border-color: #49606e; color: #c3d0d7; }
.plan-button { display: inline-flex; align-items: center; gap: 5px; }
.notification-badge { min-width: 16px; height: 16px; padding: 0 4px; display: inline-grid; place-items: center; border-radius: 999px; background: #ef6b73; color: white; font-size: 9px; }

.messages { padding: 38px clamp(18px, 4vw, 36px); overflow-y: auto; display: flex; flex-direction: column; gap: 24px; }
.message { display: flex; gap: 12px; max-width: 82%; animation: rise .25s ease-out; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.avatar { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #12252a; border: 1px solid #245158; color: #6de2df; font: 600 12px/1 monospace; }
.user .avatar { background: #1d2631; border-color: #344454; color: #b8c5cf; }
.bubble { padding: 13px 16px; border-radius: 3px 16px 16px 16px; background: #111920; border: 1px solid #1e2a34; box-shadow: 0 12px 30px rgba(0, 0, 0, .12); }
.user .bubble { border-radius: 16px 3px 16px 16px; background: #173338; border-color: #23535a; }
.bubble p { margin: 0; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { margin-top: 8px; color: #607480; font-size: 10px; }
.thinking .bubble p::after { content: ""; display: inline-block; width: 1.2em; animation: dots 1.1s steps(4, end) infinite; }
.action-card { margin-top: 14px; padding: 13px; display: grid; gap: 9px; background: #0a1117; border: 1px solid #2b3b47; border-radius: 11px; }
.action-card strong { color: #dcebed; font-size: 12px; }
.action-card code { max-width: 100%; overflow: auto; color: #86a0ad; font-size: 10px; white-space: pre-wrap; }
.action-status { color: #d6a744; font-size: 10px; }
.action-card.approved { border-color: #276849; }
.action-card.approved .action-status { color: #4ddd92; }
.action-card.rejected { border-color: #6b3439; }
.action-card.rejected .action-status { color: #ef8087; }
.action-controls { display: flex; justify-content: flex-end; gap: 8px; }
.action-controls button { padding: 8px 12px; border: 0; border-radius: 8px; background: #55d8d5; color: #071012; font-weight: 700; cursor: pointer; }
.action-controls button.secondary { background: #24323d; color: #b9c7cf; }

.composer { margin: 0 clamp(18px, 4vw, 36px); padding: 10px; display: flex; align-items: flex-end; gap: 10px; background: #101820; border: 1px solid #27343f; border-radius: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); }
textarea { flex: 1; resize: none; max-height: 180px; min-height: 42px; padding: 11px 12px; border: 0; outline: 0; background: transparent; color: #edf6f7; font: inherit; line-height: 1.45; }
textarea::placeholder { color: #5f707d; }
.composer button, dialog button { border: 0; border-radius: 11px; background: #55d8d5; color: #071012; font-weight: 700; cursor: pointer; }
.composer button { min-height: 42px; padding: 0 16px; display: flex; align-items: center; gap: 9px; }
button:disabled { opacity: .5; cursor: wait; }
.privacy { margin: 10px 0 18px; text-align: center; color: #50616d; font-size: 10px; }

dialog { width: min(430px, calc(100% - 32px)); padding: 0; color: #e9f2f4; background: #101820; border: 1px solid #293946; border-radius: 20px; box-shadow: 0 30px 100px #000; }
dialog::backdrop { background: rgba(3, 7, 10, .8); backdrop-filter: blur(10px); }
dialog form { padding: 30px; display: grid; gap: 14px; }
dialog h1 { margin: 0; font-size: 24px; }
dialog p { margin: 0 0 8px; color: #8799a6; line-height: 1.55; }
.eyebrow { color: #58d8d5; font: 700 10px/1 monospace; letter-spacing: .18em; }
dialog label { font-size: 12px; color: #a7b6c0; }
dialog input { width: 100%; padding: 13px; border: 1px solid #344653; border-radius: 10px; outline: 0; background: #0a1117; color: white; }
dialog input:focus { border-color: #55d8d5; box-shadow: 0 0 0 3px rgba(85, 216, 213, .1); }
dialog button { padding: 13px; margin-top: 4px; }
.pairing-form { border-top: 1px solid #293946; padding-top: 22px; }
.pairing-form strong { font-size: 14px; color: #dce8ec; }
.pairing-code { padding: 16px; border: 1px solid #2d6267; border-radius: 12px; background: #0a181c; color: #70eeea; font: 700 25px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; text-align: center; user-select: all; }
.pairing-help { padding: 0 8px 8px; color: #8799a6; font-size: 12px; line-height: 1.5; }
.error { min-height: 18px; color: #ef8087; font-size: 12px; }
.data-dialog { width: min(600px, calc(100% - 28px)); max-height: min(720px, calc(100vh - 40px)); }
.data-dialog > header { padding: 22px 24px 16px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #25333e; }
.data-dialog h2 { margin: 6px 0 0; font-size: 21px; }
.icon-button { width: 32px; height: 32px; border: 1px solid #31424e; border-radius: 9px; background: transparent; color: #91a3ad; font-size: 20px; cursor: pointer; }
.data-list { padding: 10px; display: grid; gap: 5px; overflow-y: auto; max-height: 560px; }
.data-row { padding: 13px; display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; border: 1px solid transparent; border-radius: 11px; background: #0c141a; }
.data-row:hover { border-color: #293a46; }
.data-row-main { min-width: 0; border: 0; padding: 0; background: transparent; color: #dce8ec; text-align: left; cursor: pointer; }
.data-row-main.static { cursor: default; }
.data-row-main strong, .data-row-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-row-main strong { font-size: 13px; }
.data-row-main span { margin-top: 5px; color: #6e828e; font-size: 10px; }
.data-row-main span.status-good { color: #4ddd92; }
.data-row-main span.status-warn { color: #efb85e; }
.data-delete { align-self: center; border: 0; padding: 7px 9px; background: transparent; color: #8f6065; cursor: pointer; }
.data-delete:hover { color: #ef8087; }
.data-read { color: #58d8d5; }
.data-row.unread { border-color: #245158; }
.data-heading { margin: 14px 8px 5px; color: #81939f; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.reminder-form { padding: 10px; display: grid; grid-template-columns: 1fr minmax(170px, auto) minmax(95px, auto) auto; gap: 8px; border-bottom: 1px solid #25333e; }
.reminder-form input, .reminder-form select { min-width: 0; padding: 11px; border: 1px solid #344653; border-radius: 9px; background: #0a1117; color: #e9f2f4; }
.reminder-form button { margin: 0; padding: 10px 12px; }
.form-error { grid-column: 1 / -1; margin: 0; color: #ef8087; font-size: 11px; }
.notification-control { margin: 4px 0 8px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #25333e; border-radius: 10px; color: #81939f; font-size: 11px; }
.notification-control button { margin: 0; padding: 8px 10px; }
.model-form { padding: 18px; display: grid; gap: 10px; }
.model-form > p:first-child { margin: 0 0 6px; color: #81939f; font-size: 12px; }
.model-form .model-usage { margin: 0 0 6px; color: #58d8d5; font: 11px/1.5 monospace; }
.model-form input { width: 100%; padding: 12px; border: 1px solid #344653; border-radius: 9px; background: #0a1117; color: #e9f2f4; }
.model-controls { display: flex; justify-content: flex-end; gap: 8px; }
.model-controls button { margin: 0; padding: 10px 12px; }
.model-controls button.secondary { background: #24323d; color: #b9c7cf; }
.session-controls { padding: 8px; display: flex; justify-content: flex-end; gap: 8px; }
.session-controls button { margin: 0; padding: 9px 11px; }
.session-controls button.danger { background: #62343a; color: #ffe8ea; }
.export-panel { margin: 8px; padding: 18px; display: grid; gap: 14px; border: 1px solid #2b3b47; border-radius: 12px; background: #0c141a; }
.export-panel p { margin: 0; color: #81939f; font-size: 12px; line-height: 1.6; }
.export-panel button { justify-self: end; margin: 0; padding: 10px 13px; }
.export-panel hr { width: 100%; border: 0; border-top: 1px solid #2b3b47; }
.export-panel input[type="file"] { padding: 10px; border: 1px solid #344653; border-radius: 9px; color: #81939f; }
.export-panel select { padding: 11px; border: 1px solid #344653; border-radius: 9px; background: #0a1117; color: #e9f2f4; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 20; width: min(360px, calc(100% - 36px)); display: grid; gap: 9px; }
.toast { padding: 14px 16px; display: grid; gap: 5px; border: 1px solid #2c6268; border-radius: 12px; background: #102329; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); animation: rise .25s ease-out; }
.toast strong { color: #68f4ef; font-size: 12px; }
.toast span { color: #d6e1e5; font-size: 12px; line-height: 1.45; }
.empty-state { padding: 36px 20px; color: #687b87; text-align: center; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
@media (max-width: 600px) { .message { max-width: 94%; } .composer button span:first-child { display: none; } .status { display: none; } .topbar { padding-inline: 14px; } .top-actions { gap: 5px; flex-wrap: wrap; justify-content: flex-end; } .utility, .logout { padding-inline: 6px; } .reminder-form { grid-template-columns: 1fr; } .form-error { grid-column: 1; } }

/* Tec Dynasty visual system — space, energy and glass command surfaces. */
:root {
  background: #050914;
  color: #edf4ff;
}

body {
  overflow: hidden;
  background:
    radial-gradient(ellipse 75% 70% at 52% 35%, rgba(37, 73, 179, .29), transparent 60%),
    radial-gradient(ellipse 45% 52% at 16% 15%, rgba(160, 62, 244, .20), transparent 66%),
    radial-gradient(ellipse 42% 55% at 90% 80%, rgba(0, 186, 249, .13), transparent 60%),
    #050914;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .42;
  background-image:
    radial-gradient(circle, rgba(226, 246, 255, .95) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(104, 207, 255, .8) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(222, 154, 255, .75) 0 1px, transparent 1.5px);
  background-size: 157px 157px, 239px 239px, 311px 311px;
  background-position: 21px 11px, 113px 71px, 15px 119px;
  mask-image: linear-gradient(to bottom, #000, transparent 92%);
}

body::after {
  content: "";
  position: fixed;
  z-index: -1;
  left: -15vw;
  right: -15vw;
  bottom: -24vh;
  height: 62vh;
  pointer-events: none;
  opacity: .38;
  background:
    linear-gradient(rgba(95, 176, 255, .20) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 176, 255, .20) 1px, transparent 1px);
  background-size: 58px 38px;
  transform: perspective(420px) rotateX(58deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 25%, transparent 94%);
}

.space-field { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.planet { position: absolute; display: block; border-radius: 50%; filter: blur(.2px); }
.planet-violet { width: 120px; height: 120px; top: 11vh; left: 11vw; background: radial-gradient(circle at 35% 28%, #e780ff, #8e26e8 40%, rgba(56, 25, 145, .2) 71%); box-shadow: 0 0 70px rgba(191, 65, 255, .52); }
.planet-cyan { width: 58px; height: 58px; bottom: 19vh; right: 12vw; background: radial-gradient(circle at 35% 28%, #bffcff, #04c8d7 45%, rgba(0, 93, 142, .2) 70%); box-shadow: 0 0 65px rgba(19, 221, 243, .52); }
.orbit { position: absolute; border: 1px solid rgba(108, 180, 255, .16); border-radius: 50%; }
.orbit-one { width: 65vw; height: 30vw; top: 25vh; right: -22vw; transform: rotate(-20deg); }
.orbit-two { width: 55vw; height: 24vw; bottom: -8vh; left: -21vw; transform: rotate(23deg); border-color: rgba(211, 113, 255, .15); }

.shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  position: relative;
  grid-template-rows: auto auto 1fr auto auto;
  isolation: isolate;
}

.shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 92px 18px 17px;
  border: 1px solid rgba(109, 170, 255, .14);
  border-radius: 28px;
  background:
    radial-gradient(ellipse 62% 53% at 48% 27%, rgba(84, 87, 235, .34), transparent 67%),
    radial-gradient(ellipse 35% 42% at 12% 77%, rgba(112, 47, 220, .22), transparent 70%),
    radial-gradient(ellipse 34% 42% at 94% 64%, rgba(0, 169, 239, .18), transparent 70%),
    linear-gradient(135deg, rgba(13, 25, 61, .72), rgba(5, 11, 28, .48));
  box-shadow: 0 28px 100px rgba(0, 0, 0, .30), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(18px);
}

.topbar {
  margin: 0 18px;
  padding: 25px clamp(18px, 3vw, 34px) 21px;
  border-bottom: 1px solid rgba(117, 173, 255, .22);
}
.brand { gap: 14px; letter-spacing: .22em; }
.brand strong { font-size: 15px; text-shadow: 0 0 18px rgba(158, 219, 255, .55); }
.brand small { color: #85a9d5; font-size: 8px; letter-spacing: .21em; }
.mark { width: 34px; height: 34px; border-color: #63e6ff; box-shadow: 0 0 28px rgba(42, 197, 255, .58), inset 0 0 14px rgba(91, 231, 255, .32); }
.mark::after { inset: 9px; background: #9af7ff; box-shadow: 0 0 16px #73e9ff; }
.top-actions { gap: 8px; }
.status { padding-right: 6px; color: #a5c6e5; }
.status.online span:first-child { box-shadow: 0 0 12px #39f0a5; }
.logout, .utility {
  border-color: rgba(112, 176, 255, .30);
  border-radius: 999px;
  background: rgba(10, 20, 48, .38);
  color: #a7c4e3;
  font-size: 10px;
  transition: .2s ease;
}
.logout:hover, .utility:hover {
  border-color: #65d7ff;
  color: #effaff;
  background: rgba(49, 102, 194, .28);
  box-shadow: 0 0 18px rgba(57, 176, 255, .22);
}
.notification-badge { background: linear-gradient(135deg, #ff5d93, #b44cff); box-shadow: 0 0 13px rgba(255, 89, 151, .65); }

.interface-readout {
  margin: 0 37px;
  padding: 11px 2px;
  display: flex;
  justify-content: space-between;
  color: rgba(150, 193, 235, .60);
  font: 700 9px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .16em;
}

.messages {
  position: relative;
  margin: 0 18px;
  padding: 44px clamp(20px, 4vw, 54px);
  gap: 25px;
  scrollbar-color: #4a8ccf transparent;
  background:
    linear-gradient(90deg, rgba(113, 77, 255, .10) 0, transparent 16%, transparent 84%, rgba(34, 179, 255, .10) 100%),
    radial-gradient(ellipse 42% 35% at 50% 46%, rgba(86, 100, 255, .18), transparent 72%);
}
.messages::before {
  content: "JARVIS";
  position: absolute;
  top: 19%; left: 50%;
  z-index: -1;
  color: rgba(173, 199, 255, .015);
  font: 900 clamp(80px, 18vw, 210px)/1 Inter, sans-serif;
  letter-spacing: .12em;
  transform: translateX(-45%);
  -webkit-text-stroke: 1px rgba(148, 192, 255, .12);
  text-shadow: 0 0 82px rgba(113, 98, 255, .36);
}
.messages::after {
  content: "PERSONAL · INTELLIGENCE · SYSTEM";
  position: absolute;
  bottom: 8%; left: 50%;
  z-index: -1;
  transform: translateX(-50%);
  color: rgba(170, 205, 255, .30);
  font: 700 10px/1 ui-monospace, monospace;
  letter-spacing: .45em;
  white-space: nowrap;
}
.message { max-width: min(76%, 700px); gap: 13px; }
.avatar { background: linear-gradient(145deg, rgba(49, 127, 189, .50), rgba(103, 54, 183, .36)); border-color: rgba(99, 221, 255, .60); color: #baf8ff; box-shadow: 0 0 20px rgba(66, 215, 255, .18); }
.user .avatar { background: linear-gradient(145deg, rgba(118, 70, 199, .48), rgba(38, 95, 167, .35)); border-color: rgba(187, 126, 255, .55); color: #f0dbff; }
.bubble { border-radius: 5px 18px 18px 18px; border-color: rgba(109, 175, 255, .26); background: linear-gradient(135deg, rgba(20, 36, 74, .74), rgba(9, 18, 43, .66)); box-shadow: 0 18px 36px rgba(0, 0, 0, .20), inset 0 1px rgba(255,255,255,.04); backdrop-filter: blur(14px); }
.user .bubble { border-radius: 18px 5px 18px 18px; border-color: rgba(190, 103, 255, .38); background: linear-gradient(135deg, rgba(92, 52, 170, .66), rgba(28, 78, 147, .62)); }
.bubble p { letter-spacing: .005em; }
.meta { color: #83b6de; }

.composer {
  margin: 0 clamp(36px, 6vw, 72px);
  border-color: rgba(102, 171, 255, .38);
  border-radius: 19px;
  background: linear-gradient(110deg, rgba(14, 30, 66, .90), rgba(19, 20, 64, .78));
  box-shadow: 0 0 0 1px rgba(176, 116, 255, .10), 0 19px 55px rgba(1, 4, 20, .48), 0 0 45px rgba(65, 125, 255, .12);
  backdrop-filter: blur(20px);
}
.composer:focus-within { border-color: #72e5ff; box-shadow: 0 0 0 3px rgba(92, 201, 255, .11), 0 18px 60px rgba(19, 72, 214, .25); }
.composer button, dialog button { background: linear-gradient(100deg, #27c9ff, #6575ff 48%, #d74dff); color: #fff; text-shadow: 0 1px 5px rgba(10, 15, 60, .55); box-shadow: 0 7px 22px rgba(85, 99, 255, .35); }
.composer button { border-radius: 12px; }
textarea::placeholder { color: #7693bb; }
.privacy { color: #7392ba; letter-spacing: .04em; }

dialog { background: linear-gradient(145deg, #101d45, #090f28); border-color: rgba(117, 179, 255, .38); box-shadow: 0 30px 100px #000, 0 0 65px rgba(81, 122, 255, .20); }
.data-row, .action-card, .export-panel { background: rgba(8, 18, 45, .78); border-color: rgba(101, 160, 244, .18); }
.data-row:hover { border-color: rgba(100, 220, 255, .58); }
.toast { border-color: rgba(89, 220, 255, .60); background: linear-gradient(135deg, #102c52, #202259); }

@media (max-width: 760px) {
  body { overflow: auto; }
  .shell::before { inset: 70px 8px 8px; border-radius: 20px; }
  .topbar { margin: 0 8px; padding: 16px 15px; align-items: flex-start; }
  .brand small { font-size: 7px; }
  .interface-readout { margin: 0 19px; font-size: 7px; letter-spacing: .10em; }
  .interface-readout span:last-child { display: none; }
  .messages { margin: 0 8px; padding: 27px 16px; }
  .messages::before { font-size: 27vw; top: 28%; }
  .messages::after { font-size: 7px; letter-spacing: .20em; }
  .composer { margin: 0 17px; }
  .planet-violet { width: 74px; height: 74px; left: 4vw; }
  .planet-cyan { right: 4vw; }
}
