﻿:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-muted: #eef3f1;
  --ink: #15201d;
  --muted: #65716d;
  --line: #dce4e1;
  --accent: #0e7a62;
  --accent-strong: #075845;
  --accent-soft: #dff3ec;
  --red: #b42318;
  --red-soft: #fde8e5;
  --blue: #2563eb;
  --blue-soft: #e7efff;
  --amber: #9a6700;
  --amber-soft: #fff2cc;
  --shadow: 0 18px 45px rgba(23, 38, 34, 0.08);
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(14, 122, 98, 0.1), transparent 260px),
    var(--bg);
  color: var(--ink);
}

.login-page {
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.home-shell {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 22px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(14, 122, 98, 0.14), rgba(37, 99, 235, 0.1)),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.home-subtitle {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.home-status {
  min-width: 220px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  text-align: right;
}

.home-status span,
.home-status strong {
  display: block;
}

.home-status span {
  color: var(--muted);
  font-size: 13px;
}

.home-status strong {
  margin-top: 6px;
  font-size: 28px;
}

.home-visual {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 220px;
}

.home-visual strong {
  font-size: 24px;
  letter-spacing: 0;
}

.assistant-orbit {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.42) 42%, transparent 43%),
    linear-gradient(145deg, rgba(20, 132, 105, 0.18), rgba(255, 204, 92, 0.22));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 22px 56px rgba(23, 61, 55, 0.16);
  animation: assistantFloat 5.6s ease-in-out infinite;
}

.assistant-orbit::before,
.assistant-orbit::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(17, 129, 104, 0.18);
  border-radius: 50%;
  animation: orbitSpin 10s linear infinite;
}

.assistant-orbit::after {
  inset: 30px;
  border-color: rgba(167, 121, 20, 0.18);
  animation-duration: 13s;
  animation-direction: reverse;
}

.assistant-face {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  width: 72px;
  height: 58px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(17, 129, 104, 0.24);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(22, 77, 67, 0.14);
}

.assistant-face span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 4.2s infinite;
}

.assistant-face i {
  grid-column: 1 / -1;
  width: 28px;
  height: 8px;
  border-bottom: 3px solid var(--amber);
  border-radius: 50%;
}

.orbit-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 8px rgba(204, 148, 33, 0.12);
}

.dot-a {
  left: 22px;
  top: 30px;
  animation: dotPulse 2.5s ease-in-out infinite;
}

.dot-b {
  right: 20px;
  top: 72px;
  background: var(--accent);
  animation: dotPulse 2.8s ease-in-out infinite 0.35s;
}

.dot-c {
  left: 66px;
  bottom: 18px;
  background: #5f7fbf;
  animation: dotPulse 3.1s ease-in-out infinite 0.7s;
}

.home-logout-link {
  justify-self: end;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
  cursor: pointer;
}

.home-logout-link:hover {
  color: var(--accent);
}

@keyframes assistantFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 90%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(0.15); }
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.78; }
  50% { transform: scale(1.35); opacity: 1; }
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.portal-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.portal-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.portal-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 26px;
  font-weight: 850;
}

.push-portal .portal-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.notes-portal .portal-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.portal-card p {
  color: var(--muted);
  line-height: 1.65;
}

.portal-card strong {
  color: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 96px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 20px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  font-size: 17px;
  letter-spacing: 0;
}

.market-clock {
  min-width: 190px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  text-align: right;
}

.market-clock span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.market-clock strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.logout-button {
  display: inline-grid;
  place-items: center;
  margin-top: 10px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 720;
  text-decoration: none;
}

.logout-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-link {
  margin-right: 6px;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-card-wide {
  width: min(620px, 100%);
}

.enhanced-login {
  background:
    radial-gradient(circle at 18% 18%, rgba(20, 132, 104, 0.14), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(49, 112, 167, 0.12), transparent 28%);
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.login-logo-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.login-intro {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.login-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 11px 12px;
  font-weight: 800;
  color: var(--muted);
}

.login-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.hidden-panel {
  display: none !important;
}

.login-card h1 {
  margin-bottom: 22px;
  font-size: 32px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form .primary-button {
  margin-top: 4px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  min-height: 106px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.05;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.entry-panel,
.results-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.entry-panel {
  position: sticky;
  top: 16px;
  padding: 18px;
}

.results-panel {
  min-height: 560px;
  padding: 18px;
}

.panel-title,
.toolbar,
.form-actions,
.card-head,
.quick-levels,
.score-row,
.price-line {
  display: flex;
  align-items: center;
}

.panel-title,
.toolbar,
.card-head,
.price-line {
  justify-content: space-between;
  gap: 12px;
}

.toolbar {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.toolbar p {
  margin-bottom: 0;
  color: var(--muted);
}

.icon-button,
.remove-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover,
.remove-button:hover,
.secondary-button:hover {
  border-color: var(--accent);
}

.holding-rows {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.holding-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.holding-main,
.alert-fields {
  display: grid;
  gap: 9px;
  align-items: end;
}

.holding-main {
  grid-template-columns: 1.25fr 0.9fr 0.8fr 36px;
}

.alert-fields {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 10px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

select {
  min-height: 38px;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 122, 98, 0.14);
}

.form-actions {
  gap: 10px;
  margin-top: 16px;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--muted);
  font-weight: 720;
}

.inline-toggle input {
  width: auto;
  min-height: auto;
}

.saved-holdings {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.saved-holdings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.saved-holdings-head h3 {
  margin: 0;
  font-size: 16px;
}

.saved-holdings-head span {
  color: var(--muted);
  font-size: 12px;
}

.holding-list {
  display: grid;
  gap: 8px;
}

.holding-list-empty,
.holding-list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.holding-list-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.holding-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.holding-list-item strong,
.holding-list-item span,
.holding-list-item small {
  display: block;
}

.holding-list-item strong {
  margin-bottom: 3px;
}

.holding-list-item span,
.holding-list-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.holding-list-actions {
  display: inline-flex;
  gap: 6px;
}

.holding-list-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 720;
}

.holding-list-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 750;
}

.primary-button {
  flex: 1;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.note {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.note strong {
  color: var(--ink);
}

.note p {
  margin: 4px 0 0;
}

.prebuy-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.compact-title h2 {
  font-size: 18px;
}

.prebuy-form,
.confirm-buy-form {
  display: grid;
  gap: 10px;
}

.confirm-buy-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.confirm-buy-form button {
  grid-column: 1 / -1;
}

.prebuy-result {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.prebuy-result.empty {
  color: var(--muted);
  background: var(--surface-muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.admin-page-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.admin-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  padding: 8px;
  backdrop-filter: blur(14px);
}

.admin-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.admin-tabs button:hover,
.admin-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.admin-pages {
  display: grid;
  gap: 16px;
  align-items: start;
}

.admin-page {
  display: none;
}

.admin-page.active {
  display: block;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 18px;
}

.app-form-grid,
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.app-form-grid button {
  align-self: end;
}

.module-grid label {
  display: grid;
  gap: 8px;
}

.module-grid select,
.admin-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
}

.module-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.module-permissions legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.module-permissions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 14px;
}

.compact-permissions {
  margin-top: 10px;
}

.compact-field {
  display: grid;
  gap: 6px;
  min-width: min(100%, 240px);
}

.compact-field span {
  color: var(--muted);
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

.admin-card label,
.admin-form {
  display: grid;
  gap: 12px;
}

.admin-card label + label {
  margin-top: 12px;
}

.admin-wide {
  grid-column: 1 / -1;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.6fr;
  gap: 12px;
}

.section-kicker {
  margin: 16px 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.default-template-list {
  margin-bottom: 8px;
}

.admin-count {
  color: var(--muted);
  font-size: 13px;
}

.template-list {
  display: grid;
  gap: 10px;
}

.template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.template-item strong {
  display: block;
  margin-bottom: 6px;
}

.template-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.weather-admin p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.prebuy-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.prebuy-head h3 {
  margin-bottom: 2px;
}

.prebuy-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.prebuy-level {
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 9px;
}

.prebuy-level span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.prebuy-level strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.market-context {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 10px;
}

.market-context strong,
.market-context small {
  display: block;
}

.market-context p {
  margin: 6px 0;
  color: var(--muted);
}

.market-context small {
  color: var(--muted);
  line-height: 1.5;
}

.notes-shell {
  width: min(1500px, calc(100% - 32px));
}

.notes-topbar h1 {
  font-size: clamp(28px, 4vw, 48px);
}

.notes-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.notes-sidebar,
.note-editor-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.notes-sidebar {
  position: sticky;
  top: 16px;
  padding: 16px;
}

.notes-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}

.note-search {
  margin-bottom: 12px;
}

.note-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.note-list-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  cursor: pointer;
}

.note-list-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 122, 98, 0.12);
}

.note-list-card.blue { border-left-color: var(--blue); }
.note-list-card.rose { border-left-color: var(--red); }
.note-list-card.amber { border-left-color: var(--amber); }
.note-list-card.ink { border-left-color: var(--ink); }

.note-list-card strong,
.note-list-card small {
  display: block;
}

.note-list-card p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.5;
}

.note-list-card small {
  color: var(--muted);
  font-size: 12px;
}

.note-editor-panel {
  padding: 18px;
  min-height: 680px;
}

.note-form {
  display: grid;
  gap: 14px;
}

.note-editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.note-title-input {
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 820;
  padding-left: 0;
}

.note-title-input:focus {
  box-shadow: none;
}

.note-content-input {
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(transparent 31px, rgba(220, 228, 225, 0.55) 32px),
    #fbfcfc;
  background-size: 100% 32px;
  line-height: 32px;
  font-size: 16px;
}

.note-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.toggle input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.watch-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.watch-button {
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  font-weight: 780;
}

.watch-button.is-running {
  border-color: var(--red);
  background: var(--red);
}

.watch-controls span {
  color: var(--muted);
  font-size: 13px;
}

.status {
  min-height: 22px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 14px;
}

.status.error {
  color: var(--red);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-panel {
  display: grid;
  gap: 14px;
}

.report-panel[hidden] {
  display: none;
}

.report-toolbar,
.report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
}

.report-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.report-metric {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.report-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.report-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.report-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.report-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

.report-table th {
  background: #fbfcfc;
  color: var(--muted);
  font-weight: 760;
}

.report-table tr:last-child td {
  border-bottom: 0;
}

.stock-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.card-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.stock-title {
  min-width: 0;
}

.stock-title h3 {
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-title span {
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.tag.hold {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tag.buy {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag.sell,
.tag.danger {
  background: var(--red-soft);
  color: var(--red);
}

.tag.wait,
.tag.neutral {
  background: var(--amber-soft);
  color: var(--amber);
}

.card-body {
  padding: 16px;
}

.price-line {
  margin-bottom: 14px;
}

.price {
  font-size: 34px;
  font-weight: 820;
  line-height: 1;
}

.change {
  font-size: 15px;
  font-weight: 760;
}

.up {
  color: var(--red);
}

.down {
  color: var(--accent);
}

.flat {
  color: var(--muted);
}

.quick-levels {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.alert-list,
.operation-panel,
.pending-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.alert-list {
  display: grid;
  gap: 8px;
}

.alert-item {
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  line-height: 1.45;
}

.alert-item.danger,
.alert-item.clear {
  background: var(--red-soft);
  color: var(--red);
}

.alert-item.buy {
  background: var(--blue-soft);
  color: var(--blue);
}

.operation-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.operation-button,
.confirm-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 720;
}

.operation-button:hover,
.confirm-button:hover {
  border-color: var(--accent);
}

.pending-panel {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

.level {
  flex: 1 1 120px;
  min-width: 120px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.level span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.level strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.score-row {
  gap: 10px;
  margin: 12px 0;
}

.score-label {
  width: 72px;
  color: var(--muted);
  font-size: 13px;
}

.score-track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-muted);
  overflow: hidden;
}

.score-fill {
  height: 100%;
  width: var(--score);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--amber), var(--red));
}

.score-number {
  width: 44px;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.detail {
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reasons {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .workspace,
  .summary-grid,
  .result-grid,
  .admin-grid,
  .portal-grid,
  .config-grid,
  .app-form-grid,
  .module-grid,
  .notes-layout,
  .note-meta-grid {
    grid-template-columns: 1fr;
  }

  .entry-panel,
  .notes-sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 12px;
  }

  .topbar,
  .home-hero,
  .toolbar,
  .report-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-status {
    width: 100%;
    text-align: left;
  }

  .portal-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .watch-controls,
  .report-actions {
    justify-content: flex-start;
  }

  .market-clock {
    width: 100%;
    text-align: left;
  }

  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .admin-tabs button {
    flex: 0 0 auto;
  }

  .holding-row {
    grid-template-columns: 1fr;
  }

  .holding-main,
  .alert-fields {
    grid-template-columns: 1fr;
  }

  .remove-button {
    width: 100%;
  }

  .holding-list-item {
    grid-template-columns: 1fr;
  }

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

  .holding-list-actions {
    width: 100%;
  }

  .holding-list-actions button {
    flex: 1;
  }

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

  .report-summary {
    grid-template-columns: 1fr;
  }
}

/* Mobile-first home and notebook refresh */
.notes-app-page {
  background:
    linear-gradient(180deg, #eef7f4 0, #f7f8f8 280px),
    #f7f8f8;
}

.notes-app {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 34px;
}

.notes-app-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 4px 18px;
}

.notes-app-top h1 {
  max-width: 720px;
  font-size: clamp(28px, 5vw, 52px);
}

.notes-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notes-nav a {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 760;
}

.notes-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.notes-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  padding: 14px;
}

.notes-stat span {
  color: var(--muted);
  font-size: 12px;
}

.notes-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.notes-workbench {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.notes-list-panel,
.modern-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.notes-list-panel {
  position: sticky;
  top: 14px;
  padding: 14px;
}

.folder-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.folder-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 760;
}

.folder-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.note-list-modern {
  max-height: calc(100vh - 260px);
}

.note-list-modern .note-list-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-left-width: 4px;
}

.note-card-main span,
.note-list-modern time {
  color: var(--muted);
  font-size: 12px;
}

.note-card-main small,
.note-preview small {
  display: inline-flex;
  margin: 4px 6px 0 0;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 3px 8px;
  font-size: 12px;
}

.modern-editor {
  padding: 16px;
}

.note-editor-toolbar,
.note-bottom-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: end;
}

.folder-picker {
  display: grid;
  gap: 6px;
}

.note-bottom-bar {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 4px;
}

.note-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.danger-button {
  color: var(--red);
}

.note-preview-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 14px;
}

.note-preview {
  color: var(--ink);
  line-height: 1.72;
}

.note-preview header {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.note-preview header span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.note-preview h2 {
  margin: 5px 0 4px;
  font-size: 26px;
}

.note-preview mark {
  border-radius: 4px;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 0 3px;
}

.preview-list {
  padding-left: 10px;
}

@media (max-width: 860px) {
  body {
    background: #f7f8f8;
  }

  .home-shell {
    min-height: auto;
    align-content: start;
    padding-bottom: 24px;
  }

  .home-hero {
    display: block;
    padding: 18px;
  }

  .home-hero h1 {
    max-width: 320px;
    font-size: 34px;
    line-height: 1.08;
  }

  .home-subtitle {
    margin-top: 10px;
    font-size: 14px;
  }

  .home-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
  }

  .home-status strong {
    font-size: 22px;
  }

  .home-visual {
    min-width: 0;
    margin-top: 16px;
  }

  .assistant-orbit {
    width: 118px;
    height: 118px;
  }

  .assistant-face {
    width: 60px;
    height: 48px;
    border-radius: 18px;
  }

  .home-logout-link {
    justify-self: start;
    margin-left: 4px;
  }

  .portal-grid {
    display: grid;
    gap: 10px;
  }

  .portal-card {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
    min-height: 0;
  }

  .portal-icon {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  .portal-card h2 {
    font-size: 20px;
  }

  .portal-card p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.55;
  }

  .notes-app {
    width: min(100% - 18px, 1320px);
    padding-top: 10px;
  }

  .notes-app-top {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 2px 12px;
  }

  .notes-app-top h1 {
    font-size: 31px;
    line-height: 1.12;
  }

  .notes-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .notes-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .notes-stat {
    padding: 10px;
  }

  .notes-stat strong {
    font-size: 18px;
  }

  .notes-workbench {
    grid-template-columns: 1fr;
  }

  .notes-list-panel {
    position: static;
  }

  .note-list-modern {
    max-height: none;
  }

  .modern-editor {
    padding: 12px;
  }

  .note-editor-toolbar,
  .note-bottom-bar {
    grid-template-columns: 1fr;
  }

  .note-title-input {
    min-height: 48px;
    font-size: 25px;
  }

  .note-content-input {
    min-height: 280px;
    font-size: 15px;
  }

  .note-actions {
    justify-content: stretch;
  }

  .note-actions button {
    flex: 1;
  }
}

