﻿:root {
  --bg-0: #f6f3ef;
  --bg-1: #fbfbfc;
  --bg-2: #f0f1f4;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --border: rgba(196, 198, 206, 0.7);
  --border-soft: rgba(196, 198, 206, 0.45);
  --accent: #0a84ff;
  --accent-2: #0f766e;
  --accent-3: #0f172a;
  --text: #16181d;
  --muted: #5f6369;
  --shadow: 0 24px 60px rgba(17, 20, 30, 0.08);
  --radius: 22px;
  --font-body: "Space Grotesk", "Noto Sans SC", sans-serif;
  --font-display: "Newsreader", "Noto Serif SC", serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 12% 8%, rgba(10, 132, 255, 0.08), transparent 45%),
    radial-gradient(circle at 90% 15%, rgba(15, 118, 110, 0.06), transparent 40%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 50%, var(--bg-2) 100%);
  color: var(--text);
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2.6rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #ffffff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: var(--font-display);
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hint {
  font-size: 0.82rem;
  color: var(--accent);
}

.badge {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-soft);
  font-size: 0.8rem;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(300px, 0.8fr);
  gap: 2.2rem;
  padding: 2.4rem 2.8rem 3rem;
  position: relative;
  z-index: 2;
  min-height: 0;
  height: calc(100vh - 88px);
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  min-height: 0;
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.7rem;
  box-shadow: var(--shadow);
  animation: fadeIn 0.6s ease-out;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

.mode-toggle {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.mode-hint {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-soft);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.toggle input {
  accent-color: var(--accent);
}

.form-grid {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.form-field input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.form-field input:focus {
  outline: none;
  border-color: rgba(0, 113, 227, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.help {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.help a {
  color: var(--accent);
  text-decoration: none;
}

.checklist {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.chat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.6rem 0.4rem 0.6rem 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 18px;
  max-width: 82%;
  line-height: 1.55;
  font-size: 0.92rem;
  animation: rise 0.25s ease-out;
}

.message.user {
  margin-left: auto;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.25);
}

.message.assistant {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-soft);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.message.thinking {
  border-style: dashed;
  color: #3f3f46;
}

.message.action {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  color: #0f172a;
  background: #fafafa;
}

.composer {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 0.5rem;
}

.composer textarea {
  flex: 1;
  resize: none;
  border-radius: 14px;
  border: none;
  padding: 0.6rem 0.8rem;
  background: transparent;
  color: var(--text);
}

.composer textarea:focus {
  outline: none;
}

.btn {
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(10, 132, 255, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid var(--border-soft);
}

.device-card {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.2rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-soft);
}

.device-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.device-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
  overflow-wrap: anywhere;
}

.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.device-note {
  font-size: 0.82rem;
  color: var(--muted);
}

.wireless-card .device-note {
  margin-top: 0.6rem;
}

.wireless-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.2rem;
}

.wireless-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.status-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-soft);
}

.status-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.status-value {
  font-size: 1rem;
  margin-top: 0.2rem;
}

.status-log {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.85);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.4);
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(420px, 90vw);
  background: var(--panel-solid);
  border-radius: 18px;
  padding: 1.6rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
}

.modal-title {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.modal-message {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.modal-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--text);
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

@media (max-width: 1000px) {
  body {
    height: auto;
    overflow-y: auto;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 1.6rem 1.4rem 2rem;
  }

  .topbar {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .device-grid {
    grid-template-columns: 1fr;
  }

  .wireless-grid {
    grid-template-columns: 1fr;
  }

}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}



select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--text);
}



.control-btn {
  border: 1px solid var(--border-soft);
  background: #f6f6f9;
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.control-btn:hover {
  background: #ececf2;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}


.panel.left {
  overflow-y: auto;
  padding-right: 0.2rem;
}

.panel.right {
  overflow-y: auto;
  padding-right: 0.2rem;
}


