/* PenEcho Cloud console: workspace views added for the 2026-07 information architecture. */

.console-body {
  --paper: #f3f5f7;
  --paper-2: #ffffff;
  --paper-3: #edf0f3;
  --ink: #191d24;
  --ink-2: #343b47;
  --ink-soft: #5b6472;
  --ink-faint: #7d8795;
  --line: #dfe3e8;
  --line-strong: #c7cdd5;
  --blue: #3157d5;
  --blue-deep: #2445b5;
  --blue-soft: #6e8af0;
  --blue-wash: #e8edfc;
  --shadow-sm: 0 1px 2px rgba(25, 29, 36, 0.05), 0 4px 12px rgba(25, 29, 36, 0.04);
  --shadow-md: 0 3px 8px rgba(25, 29, 36, 0.06), 0 16px 34px -18px rgba(25, 29, 36, 0.24);
  background: var(--paper);
}

.console-body::before { display: none; }
.console-body * { letter-spacing: 0; }

.console-body :where(button, a[href], input, select, textarea, [tabindex="0"]):focus-visible {
  outline: 3px solid rgba(49, 87, 213, 0.28);
  outline-offset: 2px;
}

.console-top {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(223, 227, 232, 0.92);
  box-shadow: 0 1px 8px rgba(25, 29, 36, 0.035);
}

.console-top .env-tag { letter-spacing: 0; white-space: nowrap; }

.console-primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-3);
}
.console-primary-nav button,
.console-primary-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 620;
  white-space: nowrap;
}
.console-primary-nav button:hover,
.console-primary-nav a:hover { background: rgba(255, 255, 255, 0.72); color: var(--ink); }
.console-primary-nav .on { background: #fff; color: var(--blue-deep); box-shadow: var(--shadow-sm); }
.top-nav-count { min-width: 20px; padding: 2px 5px; border-radius: 999px; background: var(--blue-wash); color: var(--blue-deep); font-size: 9px; font-variant-numeric: tabular-nums; }

.account-chip { display: block; padding: 0; background: var(--paper-2); }
.account-trigger { display: flex; align-items: center; gap: 10px; padding: 5px 7px 5px 5px; border-radius: inherit; text-align: left; }
.account-trigger:hover { background: var(--paper-3); }
.account-menu { border-radius: 8px; background: #fff; }

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

.console-body .button {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 620;
}

.console-head h1 {
  font-family: var(--font-ui);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.16;
}

.console-head p { max-width: 70ch; font-size: 13.5px; }
.library-label,
.library-kicker,
.console-nav .cn-label { font-weight: 650; }

.console-nav .cn-label-section {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.console-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 14.2px;
  font-weight: 540;
}

.console-nav-link:hover { background: rgba(27, 29, 36, 0.05); color: var(--ink); }
.console-nav .nav-copy { display: grid; min-width: 0; line-height: 1.25; }
.console-nav .nav-copy small { margin-top: 2px; color: var(--ink-faint); font-size: 9px; font-weight: 500; white-space: normal; }

.compact-button { padding: 8px 14px; border-radius: 7px; font-size: 12.5px; }
.console-head .library-kicker { display: block; margin: 0 0 6px; }
.console-head h1 { letter-spacing: 0; }

.section-toolbar {
  display: flex;
  align-items: end;
  gap: 18px;
  min-width: 0;
  margin-bottom: 14px;
}

.section-toolbar > div { min-width: 0; }
.section-toolbar h2 { margin-top: 3px; font-family: var(--font-ui); font-size: 19px; font-weight: 650; letter-spacing: 0; }
.section-toolbar .text-action { margin-left: auto; }

.text-action,
.step-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 620;
}

.text-action:hover,
.step-link:hover { background: var(--blue-wash); }

.state-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  color: var(--ink-soft);
  font-size: 13px;
}

.state-loading .spinner { border-color: rgba(27, 29, 36, 0.14); border-top-color: var(--blue); }
.empty.error-state { border-color: rgba(179, 64, 47, 0.35); }
.empty.error-state .hand { color: #a3382a; }

.freshness-notice {
  margin: -8px 0 16px;
  padding: 9px 12px;
  border: 1px solid rgba(160, 106, 18, 0.28);
  border-radius: 7px;
  background: rgba(160, 106, 18, 0.07);
  color: #79500e;
  font-size: 12px;
}

/* Dashboard */

.dashboard-head { margin-bottom: 22px; }

.purchase-coming-soon {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-width: 118px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f4;
  color: #4f5865;
  cursor: not-allowed;
  opacity: 1;
}
.purchase-coming-soon span { font-size: 12px; font-weight: 650; }
.purchase-coming-soon small { color: var(--blue-deep); font-size: 9.5px; font-weight: 650; }
.purchase-note {
  margin: -10px 0 20px;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: #eef3ff;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metric-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 145px;
  padding: 19px;
  border-radius: 0;
  background: var(--paper-2);
  text-align: left;
}
.metric-block:is(a) { color:inherit; text-decoration:none; }

button.metric-block:hover { background: #fff; }
.metric-block > span:first-child { color: var(--ink-soft); font-size: 11.5px; font-weight: 620; }
.metric-block strong { margin: 13px 0 6px; font: 620 30px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.metric-block small { margin-top: auto; color: var(--ink-faint); font-size: 11px; line-height: 1.4; }
.metric-block .quota-track { width: 100%; margin-top: 11px; }

.metric-credit { background: #202329; color: #fff; }
button.metric-credit:hover { background: #15171b; }
.metric-credit > span:first-child,
.metric-credit small { color: rgba(255, 255, 255, 0.64); }
.metric-credit strong { color: #f0c962; }
.metric-credit-actions { display: flex; align-items: stretch; gap: 7px; width: 100%; margin-top: 9px; }
.metric-credit-actions button { min-height: 34px; border-radius: 6px; }
.metric-link { padding: 7px 10px; border: 1px solid rgba(255, 255, 255, 0.24); color: #fff; font-size: 11px; font-weight: 650; }
.metric-link:hover { border-color: rgba(255, 255, 255, 0.58); background: rgba(255, 255, 255, 0.08); }
.metric-credit-actions .purchase-coming-soon { flex: 1; justify-content: space-between; padding: 6px 9px; border-color: rgba(240, 201, 98, 0.28); background: rgba(240, 201, 98, 0.1); color: #f5dc99; }
.metric-credit-actions .purchase-coming-soon small { margin: 0; color: rgba(255, 255, 255, 0.56); font-size: 8.5px; }
#dashboard-purchase-note { margin-top: 8px; }

.metric-block strong,
.usage-balance strong,
.usage-summary strong { font-family: var(--font-ui); }

.recent-panel { margin-top: 4px; }

.dashboard-journey {
  margin: 0 0 34px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.craft-impact { background:linear-gradient(135deg,#151822,#20283c); border-radius:14px; color:#fff; margin:18px 0; padding:22px; }
.craft-impact>header { align-items:center; display:flex; gap:18px; justify-content:space-between; }
.craft-impact h2 { font:600 25px/1.15 var(--font-display); margin:4px 0 0; }
.craft-impact .library-kicker { color:#aebcff; }
.craft-impact .text-action { color:#fff; }
.craft-impact-grid { display:grid; gap:10px; grid-template-columns:repeat(4,minmax(0,1fr)); margin-top:20px; }
.craft-impact-grid>div { background:rgb(255 255 255 / 7%); border:1px solid rgb(255 255 255 / 10%); border-radius:10px; min-width:0; padding:14px; }
.craft-impact-grid strong { display:block; font:600 28px/1 var(--font-display); }
.craft-impact-grid span { color:#c9cedc; display:block; font-size:11px; margin-top:7px; overflow-wrap:anywhere; }
.craft-impact>p { color:#c9cedc; font-size:12px; margin:15px 0 0; }
@media (max-width:720px) { .craft-impact>header{align-items:flex-start;flex-direction:column}.craft-impact-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
.dashboard-journey .section-toolbar { align-items: start; }
.dashboard-journey .section-toolbar p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.journey-trunk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
}
.journey-trunk > i,
.journey-branch > i { align-self: center; color: var(--ink-faint); font-style: normal; }
.journey-node {
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 118px;
  padding: 15px 14px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.journey-node:hover { border-color: var(--blue-soft); background: #f9fbff; }
.journey-node small { padding-right: 28px; color: var(--blue-deep); font-size: 9.5px; font-weight: 700; line-height: 1.3; text-transform: uppercase; }
.journey-node b { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.journey-node em { color: var(--ink-soft); font-size: 10.5px; font-style: normal; line-height: 1.45; overflow-wrap: anywhere; }
.journey-state {
  position: absolute;
  top: 11px;
  right: 11px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 800;
}
.journey-node[data-state="done"] { border-color: rgba(38, 112, 69, 0.32); background: rgba(38, 112, 69, 0.045); }
.journey-node[data-state="done"] .journey-state { border-color: #267045; background: #267045; color: #fff; }
.journey-node[data-state="current"] { border-color: rgba(49, 87, 213, 0.48); box-shadow: inset 0 0 0 1px rgba(49, 87, 213, 0.08); }
.journey-node[data-state="current"] .journey-state { border-color: var(--blue); background: var(--blue-wash); color: var(--blue-deep); }
.journey-node[data-state="checking"] .journey-state { animation: journey-pulse 1.1s ease-in-out infinite; border-color: var(--blue-soft); color: var(--blue-deep); }
.journey-node[data-state="unavailable"] { border-style: dashed; }
.journey-node[data-state="unavailable"] .journey-state { border-color: #a96e28; color: #8b581d; }
@keyframes journey-pulse { 50% { background: var(--blue-wash); transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) { .journey-node[data-state="checking"] .journey-state { animation: none; } }
.journey-branches { display: grid; gap: 10px; margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.journey-branch-label { color: var(--ink-faint); font-size: 10px; font-weight: 650; text-transform: uppercase; }
.journey-branch { display: grid; grid-template-columns: minmax(44px, .28fr) minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 8px; }
.journey-branch .branch-line { align-self: center; height: 1px; background: linear-gradient(90deg, var(--line), var(--blue-soft)); }
.journey-branch .journey-node { min-height: 92px; }
.recent-list { display: grid; border-top: 1px solid var(--line); }
.dashboard-canvas-grid,
.recent-canvas-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; border-top: 0; }
.dashboard-canvas-grid > .state-loading,
.dashboard-canvas-grid > .empty { grid-column: 1 / -1; }

.recent-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(140px, 0.7fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.recent-thumb {
  position: relative;
  width: 72px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0;
  cursor: pointer;
}

.recent-thumb img { width: 100%; height: 100%; object-fit: contain; }
.recent-thumb:hover { border-color: var(--blue); }
.recent-thumb:focus-visible,
.recent-title:focus-visible { outline: 3px solid rgba(46, 76, 230, 0.16); outline-offset: 2px; }
.recent-thumb .thumb-empty { display: block; width: 100%; height: 100%; background: linear-gradient(rgba(49,87,213,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(49,87,213,.05) 1px,transparent 1px),#fbfcfe; background-size: 14px 14px; }
.recent-name,
.recent-meta { display: grid; min-width: 0; line-height: 1.4; }
.recent-title { width: fit-content; max-width: 100%; overflow: hidden; padding: 0; color: var(--ink); font-size: 13.5px; font-weight: 680; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.recent-title:hover { color: var(--blue-deep); }
.recent-name span,
.recent-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-faint); font-size: 11px; }
.recent-meta span:first-child { color: var(--ink-soft); }
.recent-open { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper-2); color: var(--ink-2); font-size: 11.5px; font-weight: 620; }
.recent-open:hover { border-color: var(--blue); color: var(--blue-deep); }

.console-body .empty { border-style: solid; border-radius: 8px; background: #fff; }
.console-body .empty .hand { margin-bottom: 6px; color: var(--ink); font: 650 16px/1.35 var(--font-ui); transform: none; }
.console-body .empty p { color: var(--ink-soft); }

/* Project library */

.library-shell { grid-template-columns: 206px minmax(0, 1fr); }
.library-nav { border-radius: 8px; }
.library-nav > button,
.project-tree-head button,
.project-tree button { border-radius: 7px; }

.project-tree-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 2px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.project-tree-head > button:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  color: var(--ink-soft);
  font-size: 12.5px;
  text-align: left;
}

.project-tree-head > button:first-child small { margin-left: auto; font-family: var(--font-mono); font-size: 9px; }
.project-tree-head > button:first-child.on { color: var(--blue-deep); background: var(--blue-wash); }
#project-tree-toggle { display: grid; place-items: center; color: var(--ink-faint); }
#project-tree-toggle:hover { background: var(--paper-3); color: var(--ink); }
#project-tree-toggle span { transition: transform 0.18s ease; }
#project-tree-toggle[aria-expanded="false"] span { transform: rotate(-90deg); }

.project-tree { display: grid; gap: 2px; max-height: min(42vh, 360px); margin-top: 3px; overflow-y: auto; }
.project-tree[hidden] { display: none; }
.project-tree button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px 7px 17px;
  color: var(--ink-soft);
  text-align: left;
}

.project-tree button::before { content: ""; flex: none; width: 5px; height: 5px; border: 1px solid var(--line-strong); border-radius: 50%; }
.project-tree button:hover,
.project-tree button.on { background: rgba(27, 29, 36, 0.05); color: var(--ink); }
.project-tree button.on::before { border-color: var(--blue); background: var(--blue); }
.project-tree button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.project-tree-empty { padding: 8px 10px 5px 17px; color: var(--ink-faint); font-size: 10.5px; }

.library-main .projects { grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); }
.project-card { border-radius: 8px; }
.project-card .thumb,
.canvas-preview { background-color: #fbfcfe; }
.canvas-preview .thumb-empty { background: linear-gradient(rgba(49,87,213,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(49,87,213,.05) 1px, transparent 1px), #fbfcfe; background-size: 22px 22px; }
.project-card .pc-name { letter-spacing: 0; }
.project-card:hover { transform: translateY(-1px); }
.project-card.is-trashed { opacity: 0.78; }
.project-card.is-trashed .pc-open { cursor: default; }
.project-card.is-trashed .pc-open:disabled { color: inherit; }
.project-card .pc-meta { min-height: 0; }
.pc-actions { justify-content: flex-end; }
.pc-actions button:first-child { margin-right: auto; }
.pc-actions button { flex: none; }
.project-card.new { min-height: 250px; }

.projects.trash-mode,
.projects.sectioned-mode { display: block; }
.trash-section + .trash-section { margin-top: 30px; }
.trash-section > header {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.trash-section > header h3 { margin-top: 3px; font-size: 16px; font-weight: 650; letter-spacing: 0; }
.trash-section > header > span { margin-left: auto; color: var(--ink-faint); font: 600 11px/1 var(--font-mono); }
.trash-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 16px; }
.trash-section-empty { grid-column: 1 / -1; margin: 0; padding: 18px 0; color: var(--ink-faint); font-size: 12px; }
.trash-canvas-list { display: grid; border-top: 1px solid var(--line); }
.trash-canvas-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.trash-canvas-preview { position: relative; display: block; width: 68px; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.trash-canvas-preview .cloud-thumbnail { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.trash-canvas-preview .thumb-empty { position: absolute; inset: 0; background: #fbfbfd; }
.trash-canvas-preview .thumb-empty::after { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(46, 76, 230, 0.12); border-radius: 3px; }
.trash-canvas-copy { display: grid; min-width: 0; gap: 4px; }
.trash-canvas-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.trash-canvas-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-faint); font-size: 10.5px; }
.trash-canvas-actions { display: flex; gap: 7px; }
.trash-canvas-actions button { min-height: 32px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); color: var(--ink-soft); font-size: 11px; }
.trash-canvas-actions button:hover { border-color: var(--line-strong); color: var(--ink); }
.trash-canvas-actions .restore { color: var(--green); }
.trash-canvas-actions .danger:hover { border-color: rgba(179, 64, 47, 0.35); color: #b3402f; }

.project-detail-head { border-bottom: 1px solid var(--line); }
.project-detail-head h2 { font-family: var(--font-ui); font-size: 28px; font-weight: 700; letter-spacing: 0; }
.project-detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.project-detail-actions .project-trash { color: #a3382a; }
.canvas-grid,
.starred-canvas-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.canvas-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); box-shadow: none; }
.canvas-card:hover { border-color: var(--line-strong); }
.canvas-preview { min-height: 0; aspect-ratio: 16 / 7; border-bottom: 1px solid var(--line); }
.canvas-preview .cloud-thumbnail,
.canvas-preview .thumb-empty { display: block; width: 100%; height: 100%; min-height: 92px; object-fit: contain; background-color: #fff; }
.canvas-card-body { padding: 10px 11px 11px !important; }
.canvas-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.canvas-title-row strong { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.canvas-star { display: grid; flex: none; place-items: center; width: 27px; height: 27px; margin-left: auto; border-radius: 5px; color: var(--ink-faint); font-size: 17px; line-height: 1; }
.canvas-star:hover,
.canvas-star.on { background: #fff6d7; color: #956c00; }
.canvas-meta { display: block; margin-top: 2px !important; overflow: hidden; color: var(--ink-faint) !important; font-size: 10.5px !important; text-overflow: ellipsis; white-space: nowrap; }
.canvas-actions { gap: 5px; margin-top: 8px; }
.canvas-actions button,.canvas-actions .canvas-app-link { align-items:center; display:inline-flex; min-height:29px; padding:5px 8px; border-radius:5px; font-size:10.5px; }
.starred-section + .starred-section { margin-top: 26px; }
.starred-section > header { display: flex; align-items: end; gap: 14px; margin-bottom: 11px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.starred-section > header h3 { margin-top: 3px; font-size: 16px; font-weight: 650; letter-spacing: 0; }
.starred-section > header > span { margin-left: auto; color: var(--ink-faint); font: 600 11px/1 var(--font-mono); }
.starred-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 16px; }
.recent-canvas-section > header { display: flex; align-items: end; gap: 14px; margin-bottom: 11px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.recent-canvas-section > header h3 { margin-top: 3px; font-size: 16px; font-weight: 650; letter-spacing: 0; }
.recent-canvas-section > header > span { margin-left: auto; color: var(--ink-faint); font: 600 11px/1 var(--font-mono); }
.recent-canvas-grid { display: grid; }

/* Devices */

.device-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(28px, 5vw, 66px);
  align-items: center;
  padding: 25px 0 30px;
  border-block: 1px solid var(--line-strong);
}

.device-overview-copy .preview-pill { display: inline-flex; margin: 0 0 13px; }
.device-overview-copy h2 { max-width: 640px; font-family: var(--font-ui); font-size: 28px; font-weight: 650; line-height: 1.2; letter-spacing: 0; }
.device-overview-copy p { max-width: 670px; margin: 12px 0 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.65; }

.model-choice-summary { display: grid; border-left: 1px solid var(--line); }
.model-choice-summary > div { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px 0 14px 20px; }
.model-choice-summary > div + div { border-top: 1px solid var(--line); }
.choice-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 7px; font: 700 13px/1 var(--font-mono); }
.local-choice { background: rgba(47, 125, 79, 0.11); color: var(--green); }
.hosted-choice { background: rgba(122, 42, 60, 0.1); color: var(--maroon); }
.model-choice-summary p { display: grid; min-width: 0; margin: 0; line-height: 1.4; }
.model-choice-summary b { font-size: 13px; }
.model-choice-summary span { color: var(--ink-soft); font-size: 11.5px; }
.model-choice-summary small { color: var(--green); font-size: 10.5px; }
.model-choice-summary > div + div small { color: var(--maroon); }

.relay-architecture { padding: 28px 0; }
.relay-architecture header h2 { margin-top: 4px; font-family: var(--font-ui); font-size: 19px; font-weight: 650; letter-spacing: 0; }
.architecture-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 17px; }
.architecture-flow > i { color: var(--ink-faint); font-style: normal; }
.architecture-node { display: grid; min-width: 0; min-height: 100px; align-content: center; padding: 14px; border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 7px; background: var(--paper-2); }
.architecture-node > span { color: var(--blue); font: 600 9px/1 var(--font-mono); }
.architecture-node b { margin-top: 11px; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.35; }
.architecture-node small { margin-top: 3px; overflow-wrap: anywhere; color: var(--ink-faint); font-size: 9.5px; line-height: 1.4; }
.architecture-node.relay-node { border-top-color: var(--amber); }
.architecture-node.relay-node > span { color: var(--amber); }
.architecture-node.model-node { border-top-color: var(--green); }
.architecture-node.model-node > span { color: var(--green); }

#view-devices .setup-guide { margin-top: 0; }

.remote-canvas-access { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px; border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line)); border-radius: 8px; background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 7%, var(--paper-2)), var(--paper-2)); }
.remote-canvas-icon { align-items: center; background: var(--blue-wash); border-radius: 12px; color: var(--blue); display: flex; height: 48px; justify-content: center; width: 48px; }
.remote-canvas-icon svg { fill: none; height: 25px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 25px; }
.remote-canvas-access > div:nth-child(2) { min-width: 0; }
.remote-canvas-access h2 { margin: 3px 0 2px; font-family: var(--font-ui); font-size: 20px; font-weight: 650; }
.remote-canvas-access p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.remote-canvas-access code { display: block; margin-top: 7px; color: var(--blue); font: 600 11px/1.4 var(--font-mono); overflow-wrap: anywhere; }
.remote-canvas-access .button { white-space: nowrap; }
.remote-canvas-access .button[data-state="offline"], .remote-canvas-access .button[data-state="unlinked"] { background: var(--paper-2); border-color: var(--line-strong); color: var(--ink-soft); }
#view-devices .setup-step { min-height: 180px; }
.step-actions { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.setup-step .step-link { margin-top: 8px; margin-left: -9px; }
.security-boundary { margin-top: 22px; padding: 17px; border-radius: 8px; }
.linked-device-list { margin-top: 28px; }
.device-row { border-radius: 8px; box-shadow: none; }
.device-row .d-ico { border-radius: 7px; }
.device-row .d-who { min-width: 0; }
.device-row .d-who b,
.device-row .d-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Usage */

.usage-balance { display: grid; justify-items: end; min-width: 150px; padding-left: 18px; border-left: 1px solid var(--line); line-height: 1.1; }
.usage-balance span { color: var(--ink-soft); font-size: 11px; }
.usage-balance strong { margin-top: 7px; color: var(--maroon); font: 650 29px/1 var(--font-display); font-variant-numeric: tabular-nums; }

/* Feedback */

.feedback-reward-note {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
  padding: 18px 20px;
  border-left: 3px solid var(--green);
  background: #f3f8f4;
}
.feedback-reward-note > span { color: var(--green); font: 700 24px/1 var(--font-mono); }
.feedback-reward-note b { font-size: 14px; }
.feedback-reward-note p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.feedback-layout { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: 28px; align-items: start; }
.feedback-compose { display: grid; gap: 15px; padding-right: 28px; border-right: 1px solid var(--line); }
.feedback-compose h2,.feedback-inbox h2 { margin: 4px 0 0; font-family: var(--font-ui); font-size: 19px; letter-spacing: 0; }
.feedback-compose > div > p { margin: 5px 0 2px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.feedback-compose label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.feedback-compose input,.feedback-compose select,.feedback-compose textarea,.feedback-reply textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper-2);
  font: inherit;
  font-size: 12.5px;
}
.feedback-compose textarea,.feedback-reply textarea { resize: vertical; }
.feedback-compose input:focus,.feedback-compose select:focus,.feedback-compose textarea:focus,.feedback-reply textarea:focus { border-color: var(--blue); outline: 3px solid rgba(70, 107, 145, .12); }
.feedback-form-actions { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.feedback-form-actions span { color: var(--ink-soft); font-size: 11px; }
.feedback-workspace { display: grid; grid-template-columns: minmax(180px, .72fr) minmax(260px, 1.28fr); min-height: 440px; margin-top: 14px; border: 1px solid var(--line); }
.feedback-list { overflow-y: auto; border-right: 1px solid var(--line); background: var(--paper-3); }
.feedback-list-button { display: grid; width: 100%; gap: 5px; padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.feedback-list-button:hover,.feedback-list-button.on { background: var(--paper-2); }
.feedback-list-button.on { box-shadow: inset 3px 0 var(--blue); }
.feedback-list-button b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.feedback-list-button span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-faint); font-size: 10px; }
.feedback-status { width: fit-content; padding: 3px 6px; border-radius: 4px; color: var(--blue-deep); background: var(--blue-wash); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.feedback-status.adopted { color: #24663e; background: #e8f5ec; }
.feedback-status.closed { color: #687385; background: #eceff2; }
.feedback-thread { min-width: 0; padding: 18px; }
.feedback-thread-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.feedback-thread-head h3 { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 15px; }
.feedback-messages { display: grid; gap: 10px; max-height: 285px; margin: 15px 0; overflow-y: auto; }
.feedback-message { padding: 11px 12px; border-left: 3px solid var(--line-strong); background: var(--paper-3); }
.feedback-message.admin { border-left-color: var(--blue); background: var(--blue-wash); }
.feedback-message header { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-faint); font-size: 9.5px; }
.feedback-message header b { color: var(--ink-soft); }
.feedback-message p { margin: 6px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 12px; line-height: 1.55; }
.feedback-reply { display: grid; gap: 9px; padding-top: 14px; border-top: 1px solid var(--line); }
.feedback-reply footer { display: flex; justify-content: flex-end; }

.usage-controls { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; padding: 12px 0; border-block: 1px solid var(--line); }
.usage-source-filter { width: fit-content; margin: 3px 0 13px; }
.segmented-control { display: flex; flex: none; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper-3); }
.segmented-control button { min-height: 31px; padding: 5px 10px; border-radius: 5px; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.segmented-control button.on { background: var(--paper-2); color: var(--ink); box-shadow: var(--shadow-sm); }
.custom-range { display: flex; align-items: end; gap: 8px; margin-left: auto; }
.custom-range label { display: grid; gap: 3px; color: var(--ink-soft); font-size: 9.5px; }
.custom-range input { min-height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); font-size: 11px; }

.usage-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.usage-summary > div { display: grid; padding: 12px 18px 17px 0; }
.usage-summary > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.usage-summary span { color: var(--ink-soft); font-size: 11px; }
.usage-summary strong { margin-top: 6px; font: 620 24px/1 var(--font-display); font-variant-numeric: tabular-nums; }

.usage-chart-panel { margin-bottom: 26px; }
.chart-legend { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--ink-faint); font-size: 9.5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
.chart-legend i:nth-of-type(2) { margin-left: 6px; background: var(--maroon); }
.usage-chart { display: grid; grid-template-columns: repeat(var(--usage-columns, 7), minmax(24px, 1fr)); gap: 6px; align-items: end; min-height: 190px; padding: 20px 4px 0; border-block: 1px solid var(--line); }
.chart-column { display: grid; grid-template-rows: 130px auto; gap: 7px; min-width: 0; }
.chart-bars { display: flex; align-items: end; justify-content: center; gap: 3px; height: 130px; }
.chart-bars i { width: min(12px, 40%); min-height: 2px; border-radius: 3px 3px 1px 1px; background: var(--blue); }
.chart-bars i:last-child { background: var(--maroon); }
.chart-column small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-faint); font-size: 8.5px; text-align: center; }

.usage-ledger { margin-top: 26px; }
.usage-table-wrap { overflow-x: auto; border-block: 1px solid var(--line); }
.usage-table { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 11.5px; }
.usage-table th { padding: 10px 9px; color: var(--ink-faint); font-size: 9px; font-weight: 650; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; }
.usage-table td { padding: 13px 9px; border-top: 1px solid var(--line); color: var(--ink-soft); vertical-align: middle; }
.usage-table td:first-child { color: var(--ink-2); }
.usage-table .usage-source { display: grid; line-height: 1.4; }
.usage-table .usage-source b { color: var(--ink); font-size: 11.5px; }
.usage-table .usage-source small { color: var(--ink-faint); }
.usage-status { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 620; }
.usage-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.usage-status.pending { color: #8a6708; }
.usage-status.failed { color: #b3402f; }
.usage-charge { color: var(--maroon); font-weight: 650; font-variant-numeric: tabular-nums; }
.usage-local-free { color: var(--green); }
.usage-table .empty { border: 0; border-radius: 0; }

/* Settings */

.password-form { display: grid; max-width: 520px; }
.password-form-error { min-height: 18px; margin: -4px 0 12px; color: #b3402f; font-size: 12px; line-height: 1.45; }
.password-form .button { width: fit-content; }

/* Reusable library and authorization dialogs */

.library-dialog {
  width: min(470px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.library-dialog::backdrop { background: rgba(27, 29, 36, 0.48); backdrop-filter: blur(4px); }
.library-dialog form { padding: 22px; }
.library-dialog .m-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 6px; }
.library-dialog .m-head > div { min-width: 0; flex: 1; }
.library-dialog .m-head h3 { font-size: 23px; }
.library-dialog .m-close {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
}
.library-dialog .m-close:hover { color: var(--ink); border-color: var(--ink); }
.library-dialog .m-sub { margin: 0 0 20px; color: var(--ink-soft); font-size: 13.8px; line-height: 1.6; }
.library-dialog .field { display: grid; gap: 6px; margin-top: 18px; }
.library-dialog .field > span:first-child { font-size: 12px; font-weight: 620; }
.library-dialog .field input { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.library-dialog .field select { width: 100%; padding: 10px 34px 10px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.library-dialog .field input:focus,
.library-dialog .field select:focus { border-color: var(--blue); outline: 3px solid rgba(46, 76, 230, 0.1); }
.library-dialog .error { min-height: 17px; color: #b3402f; font-size: 11px; }
.library-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.library-dialog-actions .button { border-radius: 7px; padding: 10px 15px; font-size: 13px; }
.library-dialog-confirm-danger { background: #a3382a !important; color: #fff !important; }
.library-dialog-confirm-danger:disabled { background: #d7c8c5 !important; color: #7f706d !important; cursor: not-allowed; }
.library-dialog form[aria-busy="true"] { cursor: progress; }

.local-callback-dialog { width: min(520px, calc(100% - 32px)); }
.local-callback-scope { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; margin: 18px 0; padding: 14px; border-block: 1px solid var(--line); }
.local-callback-scope > span { display: grid; place-items: center; width: 38px; aspect-ratio: 1; border: 1px solid var(--ink); border-radius: 7px; font: 650 18px/1 var(--font-display); }
.local-callback-scope div { display: grid; gap: 4px; min-width: 0; }
.local-callback-scope b { font-size: 13px; }
.local-callback-scope small,
.local-callback-security { color: var(--ink-soft); font-size: 11.5px; line-height: 1.55; }
.local-callback-security { margin: 0; }

.profile-avatar-editor { align-items:center; display:grid; gap:16px; grid-template-columns:88px minmax(0,1fr); margin:18px 0 22px; }
.profile-avatar-preview { align-items:center; background:var(--blue-wash); border:1px solid var(--line); border-radius:22px; color:var(--blue-deep); display:flex; font-size:28px; font-weight:750; height:88px; justify-content:center; overflow:hidden; width:88px; }
.profile-avatar-preview img,.account-trigger .avatar img { display:block; height:100%; object-fit:cover; width:100%; }
.profile-avatar-editor > div { align-items:start; display:grid; gap:8px; justify-items:start; min-width:0; }
.profile-avatar-editor > div > span { color:var(--ink-soft); font-size:11px; line-height:1.5; }
#profile-panel textarea { min-height:108px; resize:vertical; width:100%; }
.profile-save-status { color:var(--ink-soft); display:inline-block; font-size:11px; margin-left:10px; }

.account-recovery-card h1 { font-size: 30px; }

@media (max-width: 1080px) {
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-overview { grid-template-columns: 1fr; }
  .model-choice-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 0; }
  .model-choice-summary > div { padding-left: 0; }
  .model-choice-summary > div + div { padding-left: 20px; border-top: 0; border-left: 1px solid var(--line); }
  .usage-controls { align-items: stretch; flex-wrap: wrap; }
  .custom-range { order: 3; width: 100%; margin-left: 0; }
  .canvas-grid,
  .starred-canvas-grid,
  .dashboard-canvas-grid,
  .recent-canvas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feedback-layout { grid-template-columns: 1fr; }
  .feedback-compose { padding-right: 0; padding-bottom: 24px; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 1180px) {
  .journey-trunk { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .journey-trunk > i { display: none; }
}

@media (max-width: 1020px) {
  .console-nav-link { white-space: nowrap; }
  .console-nav .cn-label-section { display: none; }
  .console-nav {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .console-nav > * { flex: 0 0 auto; }
  .console-nav::-webkit-scrollbar { display: none; }
}

@media (max-width: 760px) {
  .console { width: min(100% - 32px, 1240px); padding-top: 22px; }
  .console-nav { gap: 3px; margin-inline: -2px; padding-inline: 2px; }
  .console-nav button,
  .console-nav-link { min-height: 42px; }
  .recent-row { grid-template-columns: 60px minmax(0, 1fr) auto; }
  .recent-thumb { width: 60px; }
  .recent-meta { display: none; }
  .library-shell { grid-template-columns: minmax(0, 1fr); }
  .library-nav { grid-template-columns: repeat(3, max-content); }
  .library-nav > .library-label { display: none; }
  .project-tree-head { grid-column: 1 / -1; min-width: 190px; }
  .project-tree { grid-column: 1 / -1; display: flex; max-height: none; overflow-x: auto; }
  .project-tree button { flex: none; max-width: 180px; padding-left: 10px; }
  .console-nav .nav-copy small { display: none; }
  .feedback-workspace { grid-template-columns: 1fr; }
  .feedback-list { max-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
  .architecture-flow { grid-template-columns: 1fr; }
  .architecture-flow > i { transform: rotate(90deg); text-align: center; }
  .architecture-node { min-height: 82px; }
  .dashboard-journey { padding: 18px; }
  .journey-trunk,
  .journey-branch { grid-template-columns: 1fr; }
  .journey-trunk > i,
  .journey-branch > i { display: block; text-align: center; transform: rotate(90deg); }
  .journey-branch .branch-line { display: none; }
  .journey-node { min-height: 92px; }
  .remote-canvas-access { grid-template-columns: 48px minmax(0, 1fr); }
  .remote-canvas-access .button { grid-column: 1 / -1; width: 100%; }
  #view-devices .setup-step { min-height: 0; }
  .usage-chart { overflow-x: auto; grid-template-columns: repeat(var(--usage-columns, 7), minmax(42px, 1fr)); }
}

@media (max-width: 560px) {
  .console-top { flex-wrap: wrap; gap: 9px; padding: 10px 14px; }
  .console-top .brand img { height: 21px; }
  .console-top .env-tag { padding-inline: 7px; font-size: 9px; }
  .console-primary-nav { order: 2; flex: 1 0 100%; width: 100%; margin-left: 0; }
  .console-primary-nav button,
  .console-primary-nav a { flex: 1 1 0; min-width: 0; padding-inline: 9px; font-size: 11.5px; }
  .console-primary-nav .top-nav-count { display: none; }
  .console-top > .spacer { display: none; }
  .account-trigger { padding: 4px; }
  .console-head h1 { font-size: 28px; }
  .dashboard-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .dashboard-head > div { grid-column: 1 / -1; }
  .dashboard-head > .spacer { display: none; }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .metric-block { min-height: 116px; padding: 16px; }
  .dashboard-head .button { width: 100%; justify-content: center; }
  .dashboard-head .button[data-goto="projects"] { grid-column: 1 / -1; }
  .dashboard-head .purchase-coming-soon { justify-items: center; }
  .dashboard-beta-note { display: grid; width: 100%; }
  .usage-head .purchase-coming-soon { width: 100%; justify-items: start; }
  .recent-row { grid-template-columns: 54px minmax(0, 1fr); gap: 11px; }
  .recent-thumb { width: 54px; }
  .recent-open { grid-column: 2; justify-self: start; }
  .model-choice-summary { grid-template-columns: 1fr; }
  .model-choice-summary > div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .usage-balance { width: 100%; align-items: start; justify-items: start; padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .segmented-control { width: 100%; overflow-x: auto; }
  .segmented-control button { flex: 1; }
  .custom-range { display: grid; grid-template-columns: 1fr 1fr; }
  .custom-range .button { grid-column: 1 / -1; justify-content: center; }
  .usage-summary { grid-template-columns: 1fr; }
  .usage-summary > div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .library-main .projects { grid-template-columns: minmax(0, 1fr); }
  .trash-project-grid { grid-template-columns: minmax(0, 1fr); }
  .canvas-grid,
  .starred-canvas-grid,
  .dashboard-canvas-grid,
  .recent-canvas-grid { grid-template-columns: minmax(0, 1fr); }
  .trash-canvas-row { grid-template-columns: 54px minmax(0, 1fr); }
  .trash-canvas-preview { width: 54px; }
  .trash-canvas-actions { grid-column: 2; flex-wrap: wrap; }
  .library-dialog-actions { display: grid; }
  .project-detail-head h2 { font-size: 24px; }
  .project-detail-actions { width: 100%; justify-content: stretch; }
  .project-detail-actions .button { flex: 1; justify-content: center; }
  .device-overview-copy h2 { font-size: 22px; }
  .device-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; padding: 13px; }
  .device-row .d-state { grid-column: 2; margin-left: 0; }
  .device-row .d-revoke { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .account-recovery-card h1 { font-size: 26px; }
  .profile-avatar-editor { grid-template-columns:72px minmax(0,1fr); }
  .profile-avatar-preview { border-radius:18px; height:72px; width:72px; }
}

@media (max-width: 380px) {
  .console-top { gap: 7px; padding-inline: 10px; }
  .console-top .brand img { height: 19px; }
  .console-top .env-tag { padding-inline: 5px; font-size: 8.5px; }
  .console-top .env-tag { display: none; }
  .console-primary-nav button,
  .console-primary-nav a { padding-inline: 7px; font-size: 10.5px; }
  .console-body .site-language-toggle button { padding-inline: 5px; }
  .section-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .section-toolbar .text-action { margin-left: 0; }
  .trash-canvas-actions { grid-column: 1 / -1; }
}

/* Devices clarity refresh */
.devices-intro {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
}
.di-path {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
}
.di-path b { font-size: 13.5px; font-weight: 650; }
.di-path span { font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.di-default { border-left: 3px solid var(--blue); }
.di-default b { color: var(--blue-deep); }
.di-optional { border-left: 3px solid var(--green); }
.di-optional b { color: #22603c; }
.di-mobile { border-left: 3px solid var(--maroon); }
.di-mobile b { color: var(--maroon); }

#view-devices .device-overview,
#view-devices .relay-architecture,
#view-devices .setup-guide,
#view-devices .linked-device-list {
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
}
#view-devices .device-overview { border-block: 1px solid var(--line); }
#view-devices .relay-architecture { padding-bottom: 24px; }
#view-devices .security-boundary { margin-top: 18px; }
#view-devices .linked-device-list { padding-bottom: 18px; }

@media (max-width: 900px) {
  .devices-intro { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  #view-devices .device-overview,
  #view-devices .relay-architecture,
  #view-devices .setup-guide,
  #view-devices .linked-device-list { padding: 16px; }
}

/* Project library layout refresh */
#view-projects .console-head p { max-width: 62ch; }

.library-shell { gap: 24px; }

.library-nav {
  align-content: start;
  gap: 5px;
  padding: 16px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.library-nav > button,
.project-tree-head > button:first-child {
  min-height: 34px;
  font-weight: 560;
}
.library-nav > button svg { flex: none; opacity: 0.75; }
.library-nav > button.on svg { opacity: 1; }
.library-nav > button.on,
.project-tree-head > button:first-child.on {
  background: var(--blue-wash);
  color: var(--blue-deep);
  box-shadow: inset 2.5px 0 0 var(--blue);
}
.project-tree-head { margin-top: 12px; padding-top: 12px; }
.project-tree { margin-top: 4px; }
.project-tree button.on { box-shadow: inset 2.5px 0 0 var(--blue); }

.library-nav-hint {
  margin: 14px 0 0;
  padding: 11px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(46, 76, 230, 0.04);
  color: var(--ink-soft);
  font-size: 10.8px;
  line-height: 1.6;
}
.library-nav-hint b { color: var(--ink); font-weight: 650; }

.library-toolbar { gap: 18px; margin-bottom: 18px; }
.library-toolbar h2 { font-size: 24px; }
.library-sub { margin: 5px 0 0; max-width: 58ch; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }

.library-main .projects { gap: 18px; }
.project-card {
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.project-card.new {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
  box-shadow: none;
}
.project-card.new:hover { border-color: var(--blue); color: var(--blue-deep); background: rgba(46, 76, 230, 0.04); }

.project-detail-head {
  margin-bottom: 18px;
  padding: 4px 2px 18px;
}
.project-detail-head p { margin-top: 4px; color: var(--ink-soft); font-size: 12.5px; }

.recent-canvas-section,
.starred-section,
.trash-section {
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
}
.recent-canvas-section > header,
.starred-section > header,
.trash-section > header { border-bottom-color: var(--line-strong); }

@media (max-width: 760px) {
  .library-nav-hint { display: none; }
}
