/* Arunos Cloud — enterprise cloud console styling.
   Quiet white surfaces, one blue for actions, 8px controls, 16px cards, a 1280px content column. */

/* ==================== Tokens ==================== */

:root {
  color-scheme: light;

  --brand: #1366ec;
  --brand-hover: #0b57d0;
  --brand-link: #1677ff;
  --brand-tint: #eef5ff;
  --brand-ring: rgba(19, 102, 236, 0.16);

  --ink: #191c21;
  --text: #262626;
  --text-2: #595959;
  --text-3: #8c8c8c;

  --bg: #ffffff;
  --band: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --line: #ebedf0;
  --line-strong: #d9dce1;

  --ok: #1d8a4a;
  --ok-soft: #e8f7ee;
  --warn: #b35c00;
  --warn-soft: #fff4e5;
  --danger: #d4380d;
  --danger-soft: #fff1ee;

  --radius-lg: 16px;
  --radius: 8px;
  --radius-sm: 6px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 8px 20px -6px rgba(19, 102, 236, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.16);

  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --topbar-h: 64px;
  --container: 1280px;
}

/* ==================== Base ==================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font: 14px/1.6 var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--brand-link);
}

[v-cloak] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: rgba(19, 102, 236, 0.16);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #c4c8cf transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c4c8cf;
  border-radius: 999px;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.93em;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

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

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.grow {
  flex: 1;
  min-width: 0;
}

/* Content fades in once as it scrolls into view. Kept short and calm. */
[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  transition-delay: var(--d, 0ms);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.page > section {
  animation: view-in 0.3s ease both;
}

@keyframes view-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(29, 138, 74, 0.45); }
  70% { box-shadow: 0 0 0 4px rgba(29, 138, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(29, 138, 74, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ==================== Global nav ==================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 max(24px, calc((100% - var(--container)) / 2));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  flex-shrink: 0;
  text-align: left;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-item:hover {
  color: var(--brand);
}

.nav-item.active {
  color: var(--brand);
  font-weight: 600;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: var(--brand);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.wallet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
}

.wallet strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-name {
  max-width: 120px;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--brand-tint);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.avatar.sm {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

@media (max-width: 1000px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 10px 20px;
  }

  .nav {
    order: 3;
    width: 100%;
    height: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    padding: 8px 10px;
  }
}

/* ==================== Layout + headings ==================== */

.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.page-head p {
  margin-top: 4px;
  color: var(--text-3);
}

.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.section-title .icon {
  color: var(--text-3);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.section-head p {
  margin-top: 6px;
  font-size: 15px;
  color: var(--text-3);
}

.section-head.centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kicker {
  font-size: 13px;
  color: var(--text-3);
}

/* ==================== Buttons ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.btn:disabled {
  opacity: 0.45;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--brand-tint);
  border-color: transparent;
  color: var(--brand);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--brand);
  padding: 0 8px;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--brand-tint);
  border-color: transparent;
  color: var(--brand-hover);
}

.btn-danger {
  background: var(--surface);
  border-color: #f0c4bb;
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-warn {
  background: var(--surface);
  border-color: #f5d7a8;
  color: var(--warn);
}

.btn-warn:hover:not(:disabled) {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: var(--warn);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
  gap: 4px;
}

.btn-lg {
  height: 44px;
  padding: 0 24px;
  font-size: 16px;
}

.btn-icon {
  width: 32px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text-3);
}

.btn-icon:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--brand);
}

.btn-icon.btn-sm {
  width: 28px;
}

.btn-block {
  width: 100%;
}

/* Text links used for secondary actions */
.link-action,
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-link);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.link-action:hover,
.link-btn:hover {
  color: var(--brand-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-action .icon,
.link-btn .icon {
  width: 13px;
  height: 13px;
}

/* ==================== Tags, pills, notices ==================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.plain::before {
  display: none;
}

.pill.tone-ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.pill.tone-warn {
  color: var(--warn);
  background: var(--warn-soft);
}

.pill.tone-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.pill.tone-info {
  color: var(--brand);
  background: var(--brand-tint);
}

.pill.tone-muted {
  color: var(--text-3);
  background: var(--surface-2);
}

.pill.live::before {
  animation: live-pulse 3s ease-out 2;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
  color: var(--brand);
  font-size: 12px;
  white-space: nowrap;
}

.tag-cyan {
  background: var(--brand-tint);
  color: var(--brand);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
}

.notice .icon {
  margin-top: 2px;
}

.notice.warn {
  background: var(--warn-soft);
  color: #7a4300;
}

.notice.danger {
  background: var(--danger-soft);
  color: #a8230a;
}

.notice.ok {
  background: var(--ok-soft);
  color: #125f32;
}

/* ==================== Cards and stats ==================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.card-body {
  padding: 24px;
}

.card.empty,
.empty.card {
  padding: 48px 24px;
}

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

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

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.stat-icon {
  display: none;
}

.stat-label {
  font-size: 13px;
  color: var(--text-3);
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-value small {
  margin-left: 3px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
}

/* ==================== Home ==================== */

.home {
  display: block;
}

/* Hero: headline on the left, offer panel on the right, soft blue wash behind */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 56px;
  padding: 56px 48px;
  border: 1px solid #e3ecfb;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f1f7ff 0%, #ffffff 70%);
}

.hero-copy {
  min-width: 0;
}

.hero-kicker {
  font-size: 15px;
  color: var(--brand);
  font-weight: 500;
}

.hero-title {
  margin-top: 12px;
  font-size: clamp(36px, 4.4vw, 52px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero-lede {
  max-width: 540px;
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-2);
}

.hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-cta .btn-lg {
  min-width: 132px;
}

/* Offer panel: real catalogue data for the first product */
.offer {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -20px rgba(19, 102, 236, 0.22);
}

.offer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.offer-head strong {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.offer-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 16px;
  color: var(--ink);
}

.offer-price .amount {
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.offer-price .unit {
  font-size: 14px;
  color: var(--text-3);
}

.offer-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.offer-specs div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.offer-specs div:nth-child(odd) {
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.offer-specs div:nth-child(even) {
  padding-left: 16px;
}

.offer-specs dt {
  font-size: 13px;
  color: var(--text-3);
}

.offer-specs dd {
  margin-top: 2px;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.offer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.offer-foot .btn-primary {
  flex: 1;
  height: 40px;
}

/* Feature strip: four plain points, icon + title + one line */
.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.strip-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px 20px 0;
  min-width: 0;
}

.strip-item + .strip-item {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.strip-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand-tint);
  color: var(--brand);
  margin-bottom: 4px;
}

.strip-item h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.strip-item p {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.6;
}

/* Product cards */
.home-products {
  margin-top: 64px;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.product {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.product:hover {
  border-color: rgba(19, 102, 236, 0.35);
  box-shadow: var(--shadow-hover);
}

.product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.product-sub {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-3);
  min-height: 20px;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink);
}

.product-price .amount {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.product-price .unit {
  font-size: 14px;
  color: var(--text-3);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.spec {
  padding: 10px 0;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.spec:nth-child(odd) {
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.spec:nth-child(even) {
  padding-left: 14px;
}

.spec small {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}

.spec strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow-wrap: anywhere;
}

.feature-list {
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.feature-list .icon {
  color: var(--brand);
  margin-top: 3px;
  width: 14px;
  height: 14px;
}

.product-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.product-foot .meta {
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}

.product-foot .meta.low {
  color: var(--warn);
}

.center {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* Closing band */
.band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 64px;
  padding: 32px 36px;
  border-radius: var(--radius-lg);
  background: var(--band);
}

.band h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.band p {
  margin-top: 4px;
  color: var(--text-3);
}

/* ==================== Auth ==================== */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  align-items: center;
  gap: 72px;
  min-height: calc(100vh - var(--topbar-h) - 180px);
  padding: 24px 0;
}

.auth-aside h2 {
  margin-top: 8px;
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.auth-aside h2 .grad-text {
  color: var(--text-3);
}

.auth-points {
  list-style: none;
  margin-top: 24px;
  color: var(--text-2);
}

.auth-points li {
  padding: 12px 0 12px 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-size: 15px;
}

.auth-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--brand);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  justify-self: end;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.18);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-brand h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.auth-brand p {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 2px;
}

.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
}

.tabs-pill {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.tab-pill {
  height: 40px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--text-3);
  font-size: 15px;
  transition: color 0.2s, border-color 0.2s;
}

.tab-pill.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* ==================== Forms ==================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  min-width: 0;
}

.field:last-child {
  margin-bottom: 0;
}

.label {
  font-size: 14px;
  color: var(--text);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder,
.textarea::placeholder {
  color: #bfbfbf;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b5bac3;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.input:disabled {
  background: var(--surface-2);
  color: var(--text-3);
}

.input.mono {
  font-family: var(--font-mono);
  font-size: 13.5px;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c8c8c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.select option {
  background: #fff;
  color: var(--text);
}

.textarea {
  height: auto;
  min-height: 84px;
  padding: 8px 12px;
  resize: vertical;
  line-height: 1.5;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .input {
  flex: 1;
  min-width: 0;
}

.hint {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.hint.warn {
  color: var(--warn);
}

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

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

.form-section {
  margin-bottom: 24px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-title {
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

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

.choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-3);
  transition: border-color 0.2s, background 0.2s;
}

.choice:hover:not(:disabled) {
  border-color: #b5bac3;
}

.choice strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.choice .price {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.choice .save {
  font-size: 12px;
  color: var(--ok);
}

.choice.active {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--text-2);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s;
}

.switch-row:hover {
  border-color: #b5bac3;
}

.switch-row.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch-row:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.switch-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.switch-text strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.switch-text span {
  font-size: 12.5px;
  color: var(--text-3);
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 11px;
  background: #c4c8cf;
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.switch.on {
  background: var(--brand);
}

.switch.on::after {
  transform: translateX(18px);
}

.switch-row.compact {
  display: inline-flex;
  width: auto;
  padding: 3px 10px 3px 6px;
  gap: 6px;
  border: 0;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.switch-row.compact .switch {
  width: 32px;
  height: 18px;
}

.switch-row.compact .switch::after {
  width: 14px;
  height: 14px;
  top: 2px;
  left: 2px;
}

.switch-row.compact .switch.on::after {
  transform: translateX(14px);
}

.switch-row.compact .switch-text strong {
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.summary {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--text-3);
}

.summary-row .num {
  color: var(--text);
}

.summary-row.total {
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

/* ==================== Console (sidebar + content) ==================== */

.console {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.side-nav {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.side-group-title {
  padding: 10px 16px 6px;
  font-size: 12px;
  color: var(--text-3);
}

.side-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.side-item .icon {
  color: var(--text-3);
}

.side-item:hover {
  background: var(--surface-2);
  color: var(--brand);
}

.side-item.active {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 600;
}

.side-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.side-item.active .icon {
  color: var(--brand);
}

.side-item .count {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.side-item.active .count {
  background: #d6e6ff;
  color: var(--brand);
}

.side-item .count.alert {
  background: var(--warn-soft);
  color: var(--warn);
}

.console-main {
  min-width: 0;
}

/* ==================== User console: instance cards ==================== */

.inst {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.inst + .inst {
  margin-top: 16px;
}

.inst-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.inst-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.inst-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.inst-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
}

.inst-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inst-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inst-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
  min-width: 0;
}

.inst-col + .inst-col {
  border-left: 1px solid var(--line);
}

.col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.kv {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 14px;
}

.kv dt {
  color: var(--text-3);
  padding-top: 1px;
}

.kv dd {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv dd .mono {
  font-size: 13px;
}

.credential {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.credential-value {
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.inst-vnc-embed {
  border-top: 1px solid var(--line);
  background: #000;
}

.inst-vnc-embed iframe {
  display: block;
  width: 100%;
  height: 560px;
  border: 0;
}

/* ==================== Tables ==================== */

.table-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.table-card + .table-card {
  margin-top: 16px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar > div > p {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-3);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.search {
  position: relative;
  width: 240px;
  max-width: 100%;
}

.search .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  width: 14px;
  height: 14px;
}

.search .input {
  height: 32px;
  padding-left: 32px;
  font-size: 13.5px;
}

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.table th {
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

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

.table tbody tr:hover td {
  background: #fafbfc;
}

.table .sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-3);
}

.table .strong {
  font-weight: 500;
  color: var(--text);
}

.table .actions {
  white-space: nowrap;
  text-align: right;
}

.table .actions .btn + .btn {
  margin-left: 6px;
}

.table .empty-cell {
  padding: 0;
  border-bottom: 0;
}

.table tr.highlight td {
  background: #fffaf2;
}

.empty {
  padding: 44px 24px;
  text-align: center;
  color: var(--text-3);
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
}

.empty h4 {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.empty p {
  font-size: 13.5px;
  max-width: 420px;
  margin: 0 auto;
}

.empty .btn {
  margin-top: 14px;
}

.kv-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--text-3);
}

/* ==================== Admin: header + metrics ==================== */

.admin-head {
  margin-bottom: 24px;
}

.admin-head h1 {
  margin-top: 2px;
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.admin-head p {
  margin-top: 4px;
  color: var(--text-3);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.metrics .stat {
  padding: 18px 22px;
  border: 0;
  border-radius: 0;
}

.metrics .stat + .stat {
  border-left: 1px solid var(--line);
}

.metrics .stat:nth-child(n + 4) {
  border-top: 1px solid var(--line);
}

.metrics .stat:nth-child(4) {
  border-left: 0;
}

@media (min-width: 1200px) {
  .metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .metrics .stat:nth-child(n + 4) {
    border-top: 0;
  }

  .metrics .stat:nth-child(4) {
    border-left: 1px solid var(--line);
  }

  .metrics .stat:nth-child(6n + 1) {
    border-left: 0;
  }
}

/* ==================== Admin: machine management ==================== */

.machines {
  min-width: 0;
}

.machine-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

/* Underline tabs (not pills) */
.segmented {
  display: inline-flex;
  gap: 24px;
  margin-bottom: -1px;
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.segmented button:hover {
  color: var(--brand);
}

.segmented button span {
  color: var(--text-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.segmented button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.machine-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
}

.machine-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.ms-tile {
  padding: 16px 20px;
  min-width: 0;
}

.ms-tile + .ms-tile {
  border-left: 1px solid var(--line);
}

.ms-tile small {
  display: block;
  font-size: 13px;
  color: var(--text-3);
}

.ms-tile strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

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

.machine-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-width: 0;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.machine-card:hover {
  border-color: rgba(19, 102, 236, 0.35);
  box-shadow: var(--shadow-hover);
}

.mc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mc-id {
  font-size: 12.5px;
  color: var(--text-3);
}

.mc-head h3 {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.mc-head p {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-3);
}

.mc-specs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.mc-specs li + li::before {
  content: "·";
  margin: 0 8px;
  color: var(--text-3);
}

.mc-net {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mc-net div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.mc-net dt {
  font-size: 12px;
  color: var(--text-3);
}

.mc-net dd {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.mc-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.owner {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.owner strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.owner small {
  font-size: 12.5px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

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

.assigned-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.ar-owner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ar-owner > div,
.ar-machine,
.ar-cred,
.ar-billing,
.ar-status {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ar-owner strong,
.ar-machine strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ar-owner small,
.ar-machine small {
  font-size: 12.5px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.ar-cred {
  font-size: 13px;
}

.ar-billing .link-action {
  font-size: 14px;
}

.ar-status {
  align-items: flex-start;
}

.ar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-self: end;
}

.empty-wide {
  grid-column: 1 / -1;
  padding: 44px 24px;
  text-align: center;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.empty-wide h4 {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* ==================== Modal ==================== */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  animation: fade-in 0.15s ease-out;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: pop-in 0.18s ease-out;
}

.modal.wide {
  width: min(720px, 100%);
}

.modal.narrow {
  width: min(440px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.modal-head p {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-3);
}

.modal-head .btn {
  margin-right: -8px;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.modal-foot .spacer {
  margin-right: auto;
}

.confirm-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.confirm-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--brand-tint);
  color: var(--brand);
}

.confirm-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-icon.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.confirm-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.confirm-body p {
  font-size: 14px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* ==================== Toasts ==================== */

.toasts {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  max-width: 380px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  font-size: 14px;
  color: var(--text);
  animation: toast-in 0.2s ease-out;
}

.toast.success .icon {
  color: var(--ok);
}

.toast.error .icon {
  color: var(--danger);
}

.toast.info .icon {
  color: var(--brand);
}

/* ==================== Footer ==================== */

.site-foot {
  margin-top: 72px;
  background: #f5f6f8;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
}

.foot-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 24px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.brand-foot {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.brand-foot .brand-mark {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.brand-foot .brand-name {
  font-size: 15px;
  color: var(--ink);
}

.foot-brand p {
  margin-top: 4px;
  line-height: 1.7;
  color: var(--text-3);
  max-width: 320px;
}

.foot-col h4 {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.foot-col ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

.foot-col .link-btn {
  color: var(--text-2);
  font-size: 13px;
}

.foot-col .link-btn:hover {
  color: var(--brand);
}

.foot-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ==================== Responsive ==================== */

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strip-item:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .strip-item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .inst-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inst-col:nth-child(3) {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .machine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .machine-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .machine-summary .ms-tile:nth-child(3) {
    border-left: 0;
  }

  .machine-summary .ms-tile:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .assigned-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .ar-actions {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 56px;
  }

  .foot-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .console {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .side-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-group-title {
    display: none;
  }

  .side-item {
    flex-shrink: 0;
    height: 34px;
    padding: 0 12px;
  }

  .side-item.active::before {
    display: none;
  }

  .inst-body {
    grid-template-columns: 1fr;
  }

  .inst-col + .inst-col,
  .inst-col:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .auth {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 0;
    padding: 8px 0;
  }

  .auth-aside {
    display: none;
  }

  .auth-card {
    justify-self: center;
  }

  .assigned-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar {
    gap: 4px 12px;
  }

  .user-name {
    display: none;
  }

  .wallet {
    padding: 0 8px;
  }

  .page {
    padding: 24px 16px 56px;
  }

  .home-hero {
    padding: 28px 20px;
  }

  .hero-cta .btn-lg {
    flex: 1;
  }

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

  .strip-item,
  .strip-item + .strip-item {
    padding: 16px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .strip-item:first-child {
    border-top: 0;
  }

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

  .stats,
  .stats.six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat {
    padding: 14px;
  }

  .stat-value {
    font-size: 20px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics .stat {
    border-left: 0 !important;
    border-top: 0 !important;
  }

  .metrics .stat:nth-child(even) {
    border-left: 1px solid var(--line) !important;
  }

  .metrics .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line) !important;
  }

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

  .machine-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .machine-summary .ms-tile:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .machine-summary .ms-tile:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

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

  .ar-actions {
    justify-self: stretch;
  }

  .field-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .choice {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2px 10px;
  }

  .choice .save {
    width: 100%;
  }

  .search {
    width: 100%;
  }

  .segmented {
    gap: 16px;
  }

  .foot-main {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .modal-mask {
    padding: 12px;
    place-items: end center;
  }

  .modal {
    max-height: calc(100vh - 24px);
    border-radius: 12px 12px 0 0;
  }

  .modal-foot {
    flex-direction: column-reverse;
  }

  .modal-foot .btn {
    width: 100%;
  }

  .modal-foot .spacer {
    display: none;
  }

  .toasts {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 16px;
    align-items: stretch;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

/* ==================== Colour and section rhythm ==================== */

/* Each colour carries a solid tone (--c) and a light tint (--c-s) for icon tiles */
.c-blue {
  --c: #1366ec;
  --c-s: #e8f1ff;
}

.c-teal {
  --c: #0f9d8a;
  --c-s: #e3f6f3;
}

.c-amber {
  --c: #d97706;
  --c-s: #fdf1e2;
}

.c-violet {
  --c: #7b5cd6;
  --c-s: #f0ebfc;
}

.c-green {
  --c: #1d8a4a;
  --c-s: #e6f5ec;
}

.c-rose {
  --c: #d64d7a;
  --c-s: #fbe9f0;
}

/* Hero: first headline line in brand blue, faint dot grid fading out to the right */
.hero-hl {
  color: var(--brand);
}

.home-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(19, 102, 236, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(110deg, #000 0%, rgba(0, 0, 0, 0.6) 40%, transparent 75%);
  mask-image: linear-gradient(110deg, #000 0%, rgba(0, 0, 0, 0.6) 40%, transparent 75%);
  pointer-events: none;
}

/* Feature strip: each item takes its own colour */
.strip-item .strip-icon {
  background: var(--c-s);
  color: var(--c);
}

.strip-item::before {
  content: "";
  display: block;
  width: 24px;
  height: 3px;
  margin-bottom: 4px;
  border-radius: 2px;
  background: var(--c);
}

.strip-item .strip-icon {
  margin-bottom: 4px;
}

/* Tinted section: a soft band that frames a block of content */
.sec-tint {
  margin-top: 56px;
  padding: 44px;
  border-radius: 20px;
  border: 1px solid #e6edf8;
  background: linear-gradient(180deg, #f4f8fe 0%, #f8f9fb 100%);
}

/* ==================== Access path (flow) ==================== */

.flow {
  list-style: none;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

/* the dashed route runs through the centre of the four nodes */
.flow::before {
  content: "";
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 28px;
  border-top: 2px dashed #bcd0ee;
  z-index: 0;
}

.flow-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.flow-node {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 2px solid currentColor;
  box-shadow: 0 6px 16px -8px currentColor;
}

.flow-node .icon {
  width: 22px;
  height: 22px;
}

.flow-step strong {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.flow-step small {
  font-size: 13px;
  color: var(--text-3);
}

.f-grey {
  color: #8c8c8c;
}

.f-blue {
  color: #1366ec;
}

.f-teal {
  color: #0f9d8a;
}

.f-green {
  color: #1d8a4a;
}

/* ==================== Scenarios ==================== */

.home-scenes {
  margin-top: 64px;
}

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

.scene {
  padding: 22px 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.25s, border-color 0.25s;
}

.scene:hover {
  box-shadow: var(--shadow-hover);
}

.scene-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--c-s);
  color: var(--c);
  margin-bottom: 14px;
}

.scene h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.scene p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-3);
}

/* Tinted block keeps the page from reading as one flat white column */
.home-products {
  margin-top: 64px;
}

/* ==================== Responsive ==================== */

@media (max-width: 1100px) {
  .scene-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 28px;
  }

  .flow::before {
    display: none;
  }
}

@media (max-width: 720px) {
  .sec-tint {
    margin-top: 40px;
    padding: 28px 18px;
  }

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

  .flow {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-left: 4px;
  }

  .flow::before {
    display: block;
    left: 31px;
    right: auto;
    top: 28px;
    bottom: 28px;
    border-top: 0;
    border-left: 2px dashed #bcd0ee;
  }

  .flow-step {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-areas:
      "node name"
      "node desc";
    column-gap: 14px;
    align-items: center;
    text-align: left;
  }

  .flow-node {
    grid-area: node;
  }

  .flow-step strong {
    grid-area: name;
    margin-top: 0;
    align-self: end;
  }

  .flow-step small {
    grid-area: desc;
    align-self: start;
  }
}
