.app-body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 70% -10%, rgba(255, 178, 62, 0.06), transparent 38%), #0b0b0d;
}

.app-shell {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: rgba(14, 14, 16, 0.92);
  backdrop-filter: blur(20px);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 18px 14px;
}

.sidebar-head .brand-mark {
  width: 32px;
  height: 32px;
}

.sidebar-collapse {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
}
.sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  padding: 6px 14px 12px;
}

.new-script-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border-radius: 12px;
  background: var(--amber);
  color: #1a1308;
  font-size: 13.5px;
  font-weight: 760;
  box-shadow: 0 8px 24px rgba(255, 178, 62, 0.16);
  transition: background 0.18s ease, transform 0.18s ease;
}
.new-script-btn:hover {
  background: #ffc05c;
  transform: translateY(-1px);
}
.new-script-btn .icon {
  width: 17px;
  height: 17px;
}

.search-box {
  position: relative;
}
.search-box .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted-2);
}
.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 33px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.search-box input:focus {
  border-color: rgba(255, 178, 62, 0.35);
  background: rgba(255, 255, 255, 0.06);
}
.search-box input::placeholder {
  color: var(--muted-2);
}

.sidebar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 6px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.sidebar-label .count {
  color: var(--muted-2);
  font-family: var(--mono);
  letter-spacing: 0;
}

.script-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 12px;
}

.script-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 11px 12px 12px;
  border-radius: 11px;
  text-align: left;
  color: var(--text-soft);
  transition: background 0.15s ease;
}
.script-item:hover {
  background: rgba(255, 255, 255, 0.045);
}
.script-item.active {
  background: rgba(255, 178, 62, 0.09);
}
.script-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 99px;
  background: var(--amber);
}
.script-item-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.script-item.active .script-item-title {
  color: var(--amber);
}
.script-item-preview {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}
.script-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 9.5px;
}
.script-item-meta .dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--muted-2);
}
.script-item .lock-mini {
  width: 11px;
  height: 11px;
  color: var(--muted-2);
}
.script-empty {
  padding: 26px 16px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.7;
  text-align: center;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 12px 14px calc(14px + var(--safe-bottom));
}

.member-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 178, 62, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 178, 62, 0.11), rgba(255, 138, 61, 0.035));
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.member-card:hover {
  border-color: rgba(255, 178, 62, 0.36);
  background: rgba(255, 178, 62, 0.13);
}
.member-card .member-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(255, 178, 62, 0.14);
  color: var(--amber);
}
.member-card .member-icon .icon {
  width: 17px;
  height: 17px;
}
.member-card .member-text {
  min-width: 0;
  flex: 1;
}
.member-card strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-card span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-card .chevron {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}
.sidebar-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 0;
  color: var(--muted-2);
  font-size: 9.5px;
}
.sidebar-links a:hover {
  color: var(--text);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 62px;
  flex: 0 0 auto;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 13, 0.6);
  backdrop-filter: blur(16px);
}

.topbar-menu {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--text);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 11.5px;
}
.breadcrumb .current {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-weight: 600;
}
.breadcrumb .icon {
  width: 12px;
  height: 12px;
  color: var(--muted-2);
}

.topbar-spacer {
  flex: 1;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
}
.save-state .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.save-state.saving .dot {
  background: var(--amber);
  animation: pulse 1s ease-in-out infinite;
}
.save-state.error .dot {
  background: var(--red);
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(255, 178, 62, 0.24);
  border-radius: 999px;
  background: rgba(255, 178, 62, 0.07);
  color: var(--amber);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.plan-pill.free {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}
.plan-pill .icon {
  width: 12px;
  height: 12px;
}

.topbar-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease;
}
.topbar-icon:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}
.topbar-icon .icon {
  width: 18px;
  height: 18px;
}
.topbar-avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.editor-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.editor-view {
  min-height: 100%;
}

.editor-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 34px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 38px 38px 80px;
}

.editor-main {
  min-width: 0;
  max-width: 760px;
}

.doc-head {
  margin-bottom: 18px;
}

.doc-title {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.035em;
  outline: none;
}
.doc-title::placeholder {
  color: rgba(255, 255, 255, 0.18);
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 10.5px;
}
.doc-meta .dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--muted-2);
}
.doc-meta .tag {
  height: 20px;
  font-size: 9.5px;
}

.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 16px 0 12px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  width: fit-content;
  max-width: 100%;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tool-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.tool-btn .icon {
  width: 14px;
  height: 14px;
}
.tool-btn.amber {
  color: var(--amber);
}
.tool-btn.danger:hover {
  color: #ff9a9a;
  background: rgba(255, 93, 93, 0.08);
}
.tool-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 3px;
}

.doc-textarea {
  display: block;
  width: 100%;
  min-height: calc(100dvh - 390px);
  padding: 0 0 30px;
  border: 0;
  background: transparent;
  color: #e9e5db;
  font-family: var(--font);
  font-size: 18px;
  line-height: 2;
  letter-spacing: 0.012em;
  resize: none;
  outline: none;
  overflow: hidden;
}
.doc-textarea::placeholder {
  color: rgba(255, 255, 255, 0.18);
}
.doc-textarea:focus {
  color: #fffaf0;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.editor-actions .hint {
  flex: 1;
  color: var(--muted-2);
  font-size: 10px;
}
.editor-actions .btn {
  min-height: 44px;
}

.inspector {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  scrollbar-width: thin;
}

.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.inspector-head h3 {
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.01em;
}
.inspector-head .reset {
  color: var(--muted-2);
  font-size: 9.5px;
}
.inspector-head .reset:hover {
  color: var(--text);
}
.inspector-sub {
  color: var(--muted-2);
  font-size: 9.5px;
  margin-bottom: 10px;
}

.control {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.control:first-of-type {
  border-top: 0;
}
.control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.control-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}
.control-label .icon {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}
.control-value {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 10px;
}
.control-hint {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.5;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}
.segmented button {
  height: 27px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
.segmented button.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.theme-row {
  display: flex;
  gap: 7px;
}
.theme-swatch {
  width: 32px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  position: relative;
}
.theme-swatch.active {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(255, 178, 62, 0.15);
}
.theme-swatch::after {
  content: "Aa";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 700;
}
.theme-swatch.noir {
  background: #050505;
  color: #f5f1e8;
}
.theme-swatch.amber {
  background: #100d08;
  color: #ffb23e;
}
.theme-swatch.mint {
  background: #07100c;
  color: #9be8c6;
}
.theme-swatch.paper {
  background: #f1eadb;
  color: #1b1710;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toggle-row .toggle-text {
  min-width: 0;
}
.toggle-row strong {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}
.toggle-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}
.pro-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 178, 62, 0.12);
  color: var(--amber);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  vertical-align: 1px;
}
.pro-mark .icon {
  width: 8px;
  height: 8px;
}

.inspector-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 44px;
  margin-top: 8px;
  border-radius: 10px;
  background: var(--amber);
  color: #1a1308;
  font-size: 12.5px;
  font-weight: 780;
  box-shadow: 0 10px 28px rgba(255, 178, 62, 0.14);
}
.inspector-start:hover {
  background: #ffc05c;
}
.inspector-start .icon {
  width: 16px;
  height: 16px;
}
.inspector-note {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 8.5px;
  text-align: center;
  line-height: 1.5;
}

.empty-view {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 62px);
  padding: 40px 28px 70px;
}
.empty-inner {
  width: min(780px, 100%);
}
.empty-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.empty-inner h1 {
  margin-top: 14px;
  font-size: clamp(32px, 4.8vw, 52px);
  font-weight: 820;
  line-height: 1.06;
  letter-spacing: -0.05em;
}
.empty-inner h1 span {
  color: var(--muted-2);
}
.empty-inner .sub {
  max-width: 480px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 38px;
}
.template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.template-card:hover {
  border-color: rgba(255, 178, 62, 0.3);
  background: rgba(255, 178, 62, 0.045);
  transform: translateY(-2px);
}
.template-card .template-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
}
.template-card .template-icon .icon {
  width: 15px;
  height: 15px;
}
.template-card strong {
  font-size: 12px;
  font-weight: 650;
}
.template-card span {
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.55;
}

.sidebar-backdrop {
  display: none;
}

/* Paywall */
.paywall {
  width: min(880px, 100%);
}
.paywall .modal-head {
  padding-bottom: 4px;
}
.paywall-trial {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 24px 0;
  padding: 10px 13px;
  border: 1px solid rgba(155, 232, 198, 0.18);
  border-radius: 10px;
  background: rgba(155, 232, 198, 0.055);
  color: var(--mint);
  font-size: 11px;
}
.paywall-trial .icon {
  width: 15px;
  height: 15px;
}
.paywall-tabs {
  display: flex;
  gap: 4px;
  margin: 16px 24px 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.2);
}
.paywall-tabs button {
  flex: 1;
  height: 31px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.paywall-tabs button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.paywall-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  padding: 16px 24px 0;
}
.plan-option {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.plan-option:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
.plan-option.selected {
  border-color: var(--amber);
  background: rgba(255, 178, 62, 0.06);
}
.plan-option .plan-badge {
  position: absolute;
  top: -7px;
  left: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--amber);
  color: #1a1308;
  font-size: 7.5px;
  font-weight: 800;
}
.plan-option .plan-name {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
.plan-option .plan-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 7px;
}
.plan-option .plan-price .cur {
  align-self: flex-start;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.plan-option .plan-price .num {
  color: var(--text);
  font-size: 27px;
  font-weight: 820;
  letter-spacing: -0.05em;
}
.plan-option .plan-price .unit {
  color: var(--muted-2);
  font-size: 9px;
}
.plan-option .plan-desc {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.5;
}

.plan-option.team {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
}
.plan-option.team > span:first-child {
  display: flex;
  flex-direction: column;
}
.plan-option.team .plan-price {
  margin-top: 0;
}
.plan-option.team .plan-desc {
  margin-top: 2px;
}
.paywall-features {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin: 15px 24px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.paywall-features span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9.5px;
}
.paywall-features .icon {
  width: 11px;
  height: 11px;
  color: var(--green);
}
.paywall-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 24px 22px;
}
.paywall-foot .pay-total {
  flex: 1;
  min-width: 0;
}
.paywall-foot .pay-total span {
  display: block;
  color: var(--muted-2);
  font-size: 9px;
}
.paywall-foot .pay-total strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.paywall-foot .btn {
  min-width: 180px;
}

.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 24px 24px;
}
.qr-box {
  display: grid;
  place-items: center;
  width: 214px;
  height: 214px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.qr-box svg {
  width: 100%;
  height: 100%;
}
.qr-title {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}
.qr-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  line-height: 1.6;
}
.qr-amount {
  margin-top: 12px;
  color: var(--amber);
  font-size: 26px;
  font-weight: 820;
  letter-spacing: -0.04em;
}
.qr-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}
.qr-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.qr-note {
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}
.activation-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px 26px;
}
.activation-form .input {
  text-align: center;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.activation-hint {
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.6;
}

/* Account */
.account-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 24px;
}
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
}
.account-row:last-child {
  border-bottom: 0;
}
.account-row .key {
  color: var(--muted);
}
.account-row .val {
  max-width: 62%;
  color: var(--text-soft);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-row .val.mono {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px 24px;
}
.account-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* AI */
.ai-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.ai-mode {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}
.ai-mode.active {
  border-color: rgba(255, 178, 62, 0.4);
  background: var(--amber-soft);
  color: var(--amber);
}
.ai-preview {
  width: 100%;
  min-height: 220px;
  max-height: 44vh;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.9;
  resize: vertical;
  outline: none;
}
.ai-preview:focus {
  border-color: rgba(255, 178, 62, 0.4);
}
.ai-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 9px;
}

/* Remote modal */
.remote-panel {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  align-items: center;
  padding: 4px 24px 26px;
}
.remote-qr {
  display: grid;
  place-items: center;
  width: 200px;
  height: 200px;
  padding: 9px;
  border-radius: 13px;
  background: #fff;
}
.remote-qr svg {
  width: 100%;
  height: 100%;
}
.remote-code-label {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.remote-code {
  margin-top: 4px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.1;
}
.remote-pin {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.remote-pin strong {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.15em;
}
.remote-copy {
  display: flex;
  gap: 7px;
  margin-top: 14px;
}
.remote-copy .input {
  height: 36px;
  font-size: 9px;
  color: var(--muted);
}
.remote-copy .btn {
  min-height: 36px;
}
.remote-tip {
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.65;
}
.remote-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 9.5px;
}
.remote-status .live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(110, 231, 168, 0.1);
}
.remote-status.off .live-dot {
  background: var(--muted-2);
  box-shadow: none;
}

/* Install modal reused */
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Mobile */
@media (max-width: 1120px) {
  .editor-wrap {
    grid-template-columns: minmax(0, 1fr);
    max-width: 820px;
    padding: 30px 30px 90px;
  }
  .inspector {
    position: fixed;
    z-index: 70;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 92vw);
    height: 100dvh;
    overflow-y: auto;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: #121214;
    transform: translateX(102%);
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding: 20px 20px calc(24px + var(--safe-bottom));
  }
  .inspector.open {
    transform: translateX(0);
  }
  .inspector-backdrop {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: none;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
  }
  .inspector-backdrop.open {
    display: block;
  }
  .inspector-close {
    display: grid !important;
  }
  .topbar-settings {
    display: grid !important;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    z-index: 80;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    transform: translateX(-102%);
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.45);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 75;
    display: none;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
  }
  .sidebar-backdrop.open {
    display: block;
  }
  .topbar-menu {
    display: grid;
  }
  .topbar {
    padding: 0 14px;
  }
  .breadcrumb .current {
    max-width: 180px;
  }
  .editor-wrap {
    padding: 24px 20px 90px;
  }
  .doc-title {
    font-size: 25px;
  }
  .doc-textarea {
    min-height: calc(100dvh - 360px);
    font-size: 17px;
    line-height: 1.95;
  }
  .empty-view {
    padding: 32px 20px 70px;
  }
  .template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: 56px;
    gap: 8px;
  }
  .topbar .plan-pill {
    height: 27px;
    padding: 0 8px;
    font-size: 9.5px;
  }
  .save-state {
    display: none;
  }
  .topbar-icon.desktop-only {
    display: none;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .breadcrumb > span:first-child,
  .breadcrumb > .icon {
    display: none;
  }
  .breadcrumb .current {
    max-width: 170px;
  }
  .editor-wrap {
    padding: 20px 16px 100px;
  }
  .doc-title {
    font-size: 23px;
  }
  .doc-meta {
    gap: 7px;
    font-size: 9.5px;
  }
  .doc-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
    gap: 3px;
  }
  .doc-toolbar .tool-sep {
    display: none;
  }
  .doc-toolbar .tool-btn {
    justify-content: center;
    min-width: 0;
    padding: 0 4px;
  }
  .doc-textarea {
    min-height: calc(100dvh - 330px);
    font-size: 16.5px;
    line-height: 1.95;
  }
  .editor-actions {
    flex-wrap: wrap;
  }
  .editor-actions .hint {
    display: none;
  }
  .editor-actions .btn {
    flex: 1;
    min-width: 130px;
  }
  .empty-inner h1 {
    font-size: 36px;
  }
  .paywall-plans {
    grid-template-columns: 1fr;
    padding: 14px 18px 0;
  }
  .plan-option {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
  }
  .plan-option .plan-price {
    margin-top: 0;
  }
  .plan-option .plan-desc {
    display: none;
  }
  .plan-option .plan-badge {
    position: static;
    margin-left: auto;
  }
  .paywall-foot {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 18px calc(20px + var(--safe-bottom));
  }
  .paywall-foot .btn {
    width: 100%;
  }
  .paywall-trial,
  .paywall-tabs,
  .paywall-features {
    margin-left: 18px;
    margin-right: 18px;
  }
  .remote-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0 18px calc(24px + var(--safe-bottom));
  }
  .remote-code {
    text-align: center;
    font-size: 30px;
  }
  .remote-code-label {
    text-align: center;
  }
  .remote-copy {
    width: 100%;
  }
  .account-list,
  .account-actions {
    padding-left: 18px;
    padding-right: 18px;
  }
  .modal-head {
    padding-left: 18px;
    padding-right: 18px;
  }
  .modal-body {
    padding-left: 18px;
    padding-right: 18px;
  }
  .modal-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
  .qr-panel {
    padding-left: 18px;
    padding-right: 18px;
  }
  .activation-form {
    padding-left: 18px;
    padding-right: 18px;
  }
}

[hidden] {
  display: none !important;
}

.inspector-close,
.topbar-settings {
  display: none;
}

.sidebar-collapse {
  display: none;
}

body.prompter-open {
  overflow: hidden;
}

@media (max-width: 860px) {
  .sidebar-collapse {
    display: grid;
  }
}
