:root {
  color-scheme: dark;
  --bg: #0b090b;
  --panel: #151215;
  --panel-2: #1b171a;
  --panel-3: #241c20;
  --line: rgba(255, 232, 224, .105);
  --line-strong: rgba(255, 232, 224, .18);
  --text: #fff7f2;
  --muted: #b7a7a3;
  --muted-2: #837572;
  --red: #e3422d;
  --red-bright: #ff7048;
  --red-deep: #84243a;
  --red-soft: rgba(227, 66, 45, .14);
  --wine: #ad3049;
  --copper: #d17a53;
  --ivory: #f1d7c5;
  --green: #59d59c;
  --yellow: #f0c66b;
  --sidebar: 244px;
  --radius: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .48);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(173, 48, 73, .22), transparent 34%),
    radial-gradient(circle at 18% 100%, rgba(209, 122, 83, .09), transparent 32%),
    linear-gradient(140deg, #0b090b 0%, #121013 55%, #0d0a0c 100%);
  color: var(--text);
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  letter-spacing: .01em;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
::selection { color: #fff; background: rgba(227, 66, 45, .62); }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #292628; border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--red-deep); }

.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.crimson-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  z-index: -1;
  opacity: .12;
  border-radius: 50%;
  filter: blur(100px);
  background: var(--red);
  pointer-events: none;
}
.crimson-glow-a { right: -340px; top: 4%; }
.crimson-glow-b { left: 25%; bottom: -480px; opacity: .07; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 15;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(16, 13, 16, .9);
  backdrop-filter: blur(30px);
}
.sidebar::after {
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 160px;
  content: "";
  background: linear-gradient(transparent, var(--red), transparent);
  opacity: .6;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 78px;
  padding: 0 21px;
  border-bottom: 1px solid var(--line);
}
.brand-mark { width: 54px; height: 54px; flex: 0 0 auto; filter: drop-shadow(0 0 16px rgba(227,66,45,.46)); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.brand strong { display: block; font-family: "Chakra Petch", sans-serif; font-size: 17px; letter-spacing: .2em; }
.brand span { display: block; margin-top: 4px; color: var(--muted-2); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }

.main-nav { flex: 1; padding: 21px 12px; overflow-y: auto; }
.nav-label {
  margin: 15px 10px 8px;
  color: #4f4a4c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
}
.nav-label:first-child { margin-top: 0; }
.nav-group { margin-bottom: 3px; }
.nav-parent {
  display: grid;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  cursor: pointer;
  grid-template-columns: 20px 1fr 18px;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  text-align: left;
}
.nav-parent:hover { color: var(--text); background: rgba(255,255,255,.028); }
.nav-parent i { color: var(--red-bright); font-style: normal; font-size: 15px; text-align: center; transition: transform .2s ease; }
.nav-group.is-open .nav-parent i { transform: rotate(45deg); }
.nav-children { display: none; padding: 2px 0 5px 28px; }
.nav-group.is-open .nav-children { display: block; }
.nav-child { min-height: 33px !important; grid-template-columns: 1fr !important; padding-left: 12px !important; font-size: 9px !important; }
.nav-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 42px;
  margin: 2px 0;
  padding: 0 10px;
  cursor: default;
  grid-template-columns: 22px 1fr auto;
  gap: 9px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  transition: .2s ease;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.028); }
.nav-item.is-active {
  border-color: rgba(220,23,53,.18);
  background: linear-gradient(90deg, rgba(220,23,53,.13), rgba(220,23,53,.025));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--red);
}
.nav-item.is-active .nav-icon { color: var(--red-bright); filter: drop-shadow(0 0 8px rgba(255,51,82,.42)); }
.nav-item b {
  min-width: 18px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 500;
  text-align: center;
}
.nav-icon, [data-icon] { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; }
[data-icon] svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-footer { padding: 18px 21px 21px; border-top: 1px solid var(--line); }
.pulse-status { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.pulse-status span, .source-pill span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(89,213,156,.7);
}
.sidebar-footer small { display: block; color: var(--muted-2); font-size: 9px; }
.sidebar-footer .author-credit { margin-top: 4px; color: var(--copper); }

.app-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  height: 78px;
  padding: 0 28px;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(16,13,16,.78);
  backdrop-filter: blur(24px);
}
.global-search {
  display: flex;
  width: min(540px, 48vw);
  height: 40px;
  padding: 0 11px;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.025);
  color: var(--muted-2);
  transition: .2s ease;
}
.global-search:focus-within { border-color: rgba(220,23,53,.44); box-shadow: 0 0 0 3px rgba(220,23,53,.08); color: var(--red-bright); }
.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}
.global-search input::placeholder { color: #575255; }
kbd {
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #0c0c0d;
  color: var(--muted-2);
  font-family: inherit;
  font-size: 8px;
  white-space: nowrap;
}
.top-actions { display: flex; gap: 9px; align-items: center; }
.source-pill {
  display: flex;
  height: 31px;
  padding: 0 10px;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.icon-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  padding: 9px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  transition: .2s ease;
}
.icon-button:hover { border-color: rgba(220,23,53,.35); color: #fff; background: var(--red-soft); }
.profile-button {
  display: flex;
  padding: 4px 8px 4px 4px;
  gap: 8px;
  cursor: pointer;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  text-align: left;
}
.profile-button > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(220,23,53,.3);
  border-radius: 8px;
  background: linear-gradient(140deg, #2b0810, #11070a);
  color: var(--red-bright);
  font-family: Georgia, serif;
  font-size: 10px;
}
.profile-button strong, .profile-button small { display: block; }
.profile-button strong { font-size: 10px; }
.profile-button small { margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.mobile-menu { display: none; }

.main-content { width: min(1540px, 100%); min-height: calc(100vh - 78px); padding: 32px; }
.view { animation: view-in .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-eyebrow {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--red-bright);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.page-eyebrow::before { width: 20px; height: 1px; content: ""; background: var(--red); box-shadow: 0 0 8px var(--red); }
.page-title {
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 400;
  letter-spacing: -.04em;
}
.page-title em { color: var(--red-bright); font-style: normal; }
.page-subtitle { max-width: 670px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.section-head { display: flex; margin: 34px 0 14px; align-items: flex-end; justify-content: space-between; }
.section-head h2 { margin: 0; font-size: 12px; letter-spacing: .13em; text-transform: uppercase; }
.section-head p { margin: 0; color: var(--muted-2); font-size: 9px; }

.hero {
  position: relative;
  min-height: 240px;
  padding: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(110deg, rgba(227,66,45,.15), transparent 43%),
    radial-gradient(circle at 85% 50%, rgba(209,122,83,.09), transparent 31%),
    linear-gradient(145deg, #21171b, #121013 68%);
  box-shadow: var(--shadow);
}
.hero::before, .hero::after {
  position: absolute;
  width: 310px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: .45;
  transform: rotate(-34deg);
}
.hero::before { right: -70px; top: 80px; }
.hero::after { right: -10px; top: 140px; }
.hero-copy { position: relative; z-index: 2; max-width: 700px; }
.hero-actions { display: flex; margin-top: 23px; gap: 9px; flex-wrap: wrap; }
.hero-wing {
  position: absolute;
  right: 6%;
  top: 50%;
  width: 225px;
  height: 225px;
  object-fit: contain;
  opacity: .62;
  filter: drop-shadow(0 0 25px rgba(227,66,45,.28)) saturate(.9);
  transform: translateY(-50%);
}

.primary-button, .ghost-button, .small-button, .filter-button {
  display: inline-flex;
  min-height: 36px;
  padding: 0 13px;
  gap: 7px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  transition: .2s ease;
}
.primary-button { border-color: var(--red); background: linear-gradient(135deg, var(--red), #9e1028); color: #fff; box-shadow: 0 8px 22px rgba(220,23,53,.2); }
.primary-button:hover { transform: translateY(-1px); background: linear-gradient(135deg, var(--red-bright), var(--red)); box-shadow: 0 10px 28px rgba(220,23,53,.32); }
.ghost-button, .small-button, .filter-button { border-color: var(--line); background: rgba(255,255,255,.025); color: var(--muted); }
.ghost-button:hover, .small-button:hover, .filter-button:hover, .filter-button.is-active { border-color: rgba(220,23,53,.35); background: var(--red-soft); color: #fff; }
.small-button { min-height: 30px; padding: 0 9px; font-size: 9px; }
.small-button.danger:hover { border-color: rgba(220,23,53,.55); color: var(--red-bright); }
.primary-button [data-icon], .ghost-button [data-icon], .small-button [data-icon] { width: 14px; height: 14px; }

.stats-grid { display: grid; margin-top: 18px; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.stat-card {
  position: relative;
  min-height: 105px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.025), rgba(255,255,255,.008));
}
.stat-card::after { position: absolute; right: -25px; bottom: -35px; width: 90px; height: 90px; content: ""; border: 1px solid rgba(220,23,53,.13); border-radius: 50%; }
.stat-card span { color: var(--muted-2); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.stat-card strong { display: block; margin: 9px 0 3px; font-family: "Chakra Petch", sans-serif; font-size: 27px; font-weight: 600; }
.stat-card small { color: var(--muted-2); font-size: 8px; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.quick-card {
  position: relative;
  min-height: 148px;
  padding: 19px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  text-align: left;
  transition: .25s ease;
}
.quick-card:hover { transform: translateY(-3px); border-color: rgba(220,23,53,.28); background: linear-gradient(145deg, rgba(220,23,53,.07), var(--panel)); box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.quick-card .quick-icon { display: grid; width: 34px; height: 34px; margin-bottom: 22px; place-items: center; border: 1px solid rgba(220,23,53,.22); border-radius: 9px; background: var(--red-soft); color: var(--red-bright); }
.quick-card .quick-icon [data-icon] { width: 16px; height: 16px; }
.quick-card strong { display: block; margin-bottom: 5px; font-family: "Chakra Petch", sans-serif; font-size: 16px; font-weight: 600; }
.quick-card small { color: var(--muted-2); font-size: 9px; }
.quick-card::after { position: absolute; right: 14px; bottom: 12px; content: "↗"; color: #393436; font-size: 15px; transition: .2s ease; }
.quick-card:hover::after { color: var(--red-bright); transform: translate(2px,-2px); }

.recent-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.recent-card {
  display: flex;
  min-height: 72px;
  padding: 13px;
  gap: 12px;
  cursor: pointer;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.015);
  transition: .2s ease;
}
.recent-card:hover { border-color: rgba(220,23,53,.28); background: rgba(220,23,53,.04); }
.recent-card .doc-symbol { display: grid; width: 36px; height: 36px; padding: 8px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #111; color: var(--red-bright); }
.recent-card strong { display: block; margin-bottom: 4px; font-size: 10px; }
.recent-card small { color: var(--muted-2); font-size: 8px; text-transform: uppercase; }

.library-layout { display: grid; height: calc(100vh - 142px); min-height: 600px; grid-template-columns: 310px 1fr; gap: 13px; }
.library-sidebar, .document-panel, .command-sidebar, .command-panel, .air-form, .air-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8,8,8,.82);
  box-shadow: 0 18px 55px rgba(0,0,0,.2);
}
.library-sidebar, .command-sidebar { display: flex; min-height: 0; flex-direction: column; overflow: hidden; }
.library-header { padding: 18px; border-bottom: 1px solid var(--line); }
.library-header h1 { margin: 0 0 5px; font-family: "Chakra Petch", sans-serif; font-size: 24px; font-weight: 600; }
.library-header p { margin: 0 0 15px; color: var(--muted-2); font-size: 9px; }
.inline-search {
  display: flex;
  height: 34px;
  padding: 0 9px;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #060606;
  color: var(--muted-2);
}
.inline-search input { width: 100%; border: 0; outline: 0; background: none; color: var(--text); font-size: 10px; }
.inline-search [data-icon] { width: 14px; height: 14px; }
.library-list { min-height: 0; padding: 8px; overflow-y: auto; }
.doc-list-button {
  display: grid;
  width: 100%;
  min-height: 58px;
  margin-bottom: 3px;
  padding: 9px 10px;
  cursor: pointer;
  grid-template-columns: 29px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  transition: .16s ease;
}
.doc-list-button:hover { background: rgba(255,255,255,.025); }
.doc-list-button.is-active { border-color: rgba(220,23,53,.2); background: var(--red-soft); }
.doc-list-button .doc-symbol { display: grid; width: 29px; height: 29px; padding: 6px; place-items: center; border-radius: 7px; background: #111; color: var(--muted); }
.doc-list-button.is-active .doc-symbol { background: rgba(220,23,53,.16); color: var(--red-bright); }
.doc-list-button strong { display: block; max-width: 210px; overflow: hidden; color: #b9b4b6; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.doc-list-button.is-active strong { color: #fff; }
.doc-list-button small { display: block; margin-top: 4px; color: #4e494b; font-size: 8px; }

.document-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; }
.document-top {
  display: flex;
  min-height: 78px;
  padding: 14px 18px;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.document-title-wrap { min-width: 0; }
.document-title-wrap .crumb { display: block; margin-bottom: 6px; color: var(--red-bright); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.document-title-wrap h2 { max-width: 600px; margin: 0; overflow: hidden; font-family: "Chakra Petch", sans-serif; font-size: 20px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.document-actions { display: flex; gap: 6px; }
.document-editor-wrap { display: grid; min-height: 0; flex: 1; grid-template-rows: auto 1fr; }
.editor-toolbar { display: flex; min-height: 45px; padding: 7px 16px; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.012); }
.editor-toolbar span { margin-right: 4px; color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.privacy-chip { margin-left: auto; color: var(--copper); font-size: 8px; font-weight: 500; letter-spacing: .05em; }
.source-lock { color: var(--green); font-size: 8px; font-weight: 500; letter-spacing: .05em; }
.insert-chip { padding: 4px 7px; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: #0c0c0c; color: var(--muted); font-size: 8px; transition: .15s ease; }
.insert-chip:hover { border-color: rgba(220,23,53,.3); color: var(--red-bright); }
.document-editor {
  width: 100%;
  min-height: 0;
  padding: 26px 30px 60px;
  resize: none;
  border: 0;
  outline: 0;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 100% 30px,
    transparent;
  color: #d8d3d5;
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 2.5;
  caret-color: var(--red-bright);
}

.mask-stack {
  min-height: 0;
  padding: 15px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(255,255,255,.014) 1px, transparent 1px) 0 0 / 100% 30px,
    rgba(8,7,9,.22);
}
.mask-card {
  margin-bottom: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(35,28,32,.96), rgba(20,17,20,.98));
  box-shadow: 0 12px 34px rgba(0,0,0,.18);
}
.mask-card:last-child { margin-bottom: 0; }
.mask-card:focus-within { border-color: rgba(209,122,83,.42); box-shadow: 0 0 0 3px rgba(209,122,83,.055), 0 16px 40px rgba(0,0,0,.24); }
.mask-card-head {
  display: flex;
  min-height: 54px;
  padding: 9px 11px 9px 15px;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(227,66,45,.08), rgba(209,122,83,.025));
}
.mask-card-head > div:first-child { min-width: 0; }
.mask-card-head span, .mask-card-head strong { display: block; }
.mask-card-head span { margin-bottom: 3px; color: var(--red-bright); font-size: 7px; font-weight: 600; letter-spacing: .16em; }
.mask-card-head strong { overflow: hidden; color: var(--ivory); font-size: 10px; letter-spacing: .045em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.mask-card-tools { display: flex; flex: 0 0 auto; gap: 8px; align-items: center; }
.mask-card-tools small { color: var(--muted-2); font-size: 7px; text-transform: uppercase; letter-spacing: .08em; }
.mask-content {
  padding: 17px 18px 20px;
  color: #ddd4d2;
  font-size: 10px;
  line-height: 2.2;
  white-space: normal;
}
.mask-input {
  width: clamp(110px, 22vw, 230px);
  height: 27px;
  margin: 2px 4px;
  padding: 0 8px;
  border: 1px solid rgba(209,122,83,.34);
  border-radius: 6px;
  outline: 0;
  background: rgba(209,122,83,.075);
  color: #fff7f2;
  font: 500 9px "JetBrains Mono", monospace;
  vertical-align: middle;
}
.mask-input::placeholder { color: #8f746a; }
.mask-input:focus { border-color: var(--copper); background: rgba(209,122,83,.12); box-shadow: 0 0 0 3px rgba(209,122,83,.08); }
.inline-document-link { color: #ffad91; text-decoration: underline; text-decoration-color: rgba(255,173,145,.45); text-underline-offset: 3px; }
.inline-document-link:hover { color: #fff; }

.empty-state { display: grid; min-height: 340px; padding: 30px; place-content: center; color: var(--muted-2); text-align: center; }
.empty-state .empty-mark { margin: 0 auto 17px; color: var(--red-deep); font-family: "Chakra Petch", sans-serif; font-size: 55px; }
.empty-state h3 { margin: 0 0 6px; color: #b9b4b6; font-family: "Chakra Petch", sans-serif; font-size: 19px; font-weight: 600; }
.empty-state p { max-width: 360px; margin: 0; font-size: 10px; line-height: 1.7; }

.commands-layout { display: grid; grid-template-columns: 260px 1fr; gap: 13px; }
.command-sidebar { height: calc(100vh - 142px); }
.command-categories { padding: 9px; overflow-y: auto; }
.command-category {
  display: flex;
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  text-align: left;
}
.command-category:hover, .command-category.is-active { border-color: rgba(220,23,53,.18); background: var(--red-soft); color: #fff; }
.command-category b { color: var(--muted-2); font-size: 8px; }
.command-panel { min-height: calc(100vh - 142px); padding: 20px; }
.command-panel-head { display: flex; margin-bottom: 16px; gap: 20px; align-items: flex-end; justify-content: space-between; }
.command-panel-head h1 { margin: 0 0 4px; font-family: "Chakra Petch", sans-serif; font-size: 25px; font-weight: 600; }
.command-panel-head p { margin: 0; color: var(--muted-2); font-size: 9px; }
.command-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.command-card {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #080808;
  transition: .2s ease;
}
.command-card:hover { border-color: rgba(220,23,53,.25); background: #0b090a; }
.command-card strong { display: block; margin: 0 34px 9px 0; color: #c8c3c5; font-size: 9px; }
.command-card code { display: block; overflow: hidden; color: #d27081; font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace; font-size: 9px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.command-copy { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; }
.command-info { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 9px; }
.command-info summary { display: grid; width: 22px; height: 22px; cursor: pointer; place-items: center; border: 1px solid rgba(209,122,83,.28); border-radius: 50%; color: var(--copper); font: 600 10px "JetBrains Mono", monospace; list-style: none; }
.command-info summary::-webkit-details-marker { display: none; }
.command-info div { margin-top: 9px; padding: 10px; border-radius: 8px; background: rgba(209,122,83,.055); color: var(--muted); font-size: 8px; line-height: 1.7; }
.command-info strong { margin: 0 0 3px; color: var(--ivory); }
.command-info p { margin: 0; }
.safety-note { display: flex; margin-bottom: 14px; padding: 10px 12px; gap: 9px; align-items: center; border: 1px solid rgba(240,198,107,.15); border-radius: 9px; background: rgba(240,198,107,.04); color: #b5a47e; font-size: 9px; }
.safety-note [data-icon] { width: 14px; color: var(--yellow); }

.air-layout { display: grid; grid-template-columns: minmax(360px, .82fr) minmax(420px, 1.18fr); gap: 13px; }
.air-form, .air-preview { min-width: 0; padding: 22px; }
.calculator-shell { display:grid; margin-top:25px; grid-template-columns:290px minmax(0,1fr); gap:13px; }
.calculator-menu,.calculator-workspace { border:1px solid var(--line); border-radius:var(--radius); background:rgba(8,8,8,.82); box-shadow:0 18px 55px rgba(0,0,0,.2); }
.calculator-menu { padding:10px; align-self:start; }
.calculator-menu-title { padding:12px 10px 14px; color:var(--muted-2); font-size:8px; letter-spacing:.13em; text-transform:uppercase; }
.calc-tab { display:grid; width:100%; min-height:64px; margin-bottom:4px; padding:10px; cursor:pointer; grid-template-columns:32px 1fr; gap:10px; align-items:center; border:1px solid transparent; border-radius:9px; background:transparent; color:var(--muted); text-align:left; }
.calc-tab:hover,.calc-tab.is-active { border-color:rgba(220,23,53,.2); background:var(--red-soft); color:#fff; }
.calc-tab .calc-symbol { display:grid; width:32px; height:32px; place-items:center; border:1px solid var(--line); border-radius:8px; background:#0b0b0b; color:var(--red-bright); font:600 12px "JetBrains Mono",monospace; }
.calc-tab strong,.calc-tab small { display:block; }
.calc-tab strong { font-size:9px; }
.calc-tab small { margin-top:3px; color:var(--muted-2); font-size:7px; }
.calculator-workspace { min-width:0; padding:22px; }
.calc-result-card { margin-top:18px; padding:18px; border:1px solid rgba(220,23,53,.2); border-radius:12px; background:linear-gradient(140deg,rgba(220,23,53,.07),#070707); }
.calc-result-top { display:flex; margin-bottom:15px; gap:12px; align-items:center; justify-content:space-between; }
.calc-result-top span { color:var(--muted-2); font-size:8px; letter-spacing:.12em; text-transform:uppercase; }
.calc-result-top strong { display:block; margin-top:4px; color:#fff; font:600 27px "Chakra Petch",sans-serif; }
.calc-formula { margin-bottom:13px; padding:10px; border:1px solid var(--line); border-radius:8px; background:#050505; color:#9d9296; font:8px/1.7 "JetBrains Mono",monospace; overflow-wrap:anywhere; }
.calc-mask { width:100%; min-height:190px; padding:13px; resize:vertical; border:1px solid var(--line); border-radius:9px; outline:0; background:#050505; color:#d4ced0; font:9px/1.8 "JetBrains Mono",monospace; }
.calc-mask:focus { border-color:rgba(220,23,53,.45); }
.panel-heading { display: flex; margin-bottom: 20px; align-items: center; justify-content: space-between; }
.panel-heading h2 { margin: 0; font-family: "Chakra Petch", sans-serif; font-size: 22px; font-weight: 600; }
.panel-heading small { color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--muted); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #070707;
  color: var(--text);
  font-size: 10px;
  transition: .2s ease;
}
.form-field textarea { min-height: 80px; resize: vertical; line-height: 1.65; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: rgba(220,23,53,.45); box-shadow: 0 0 0 3px rgba(220,23,53,.07); }
.form-actions { display: flex; margin-top: 18px; gap: 8px; }
.privacy-note { display: flex; margin-top: 15px; gap: 7px; color: var(--muted-2); font-size: 8px; line-height: 1.6; }
.privacy-note span { color: var(--copper); }
.air-output {
  width: 100%;
  min-height: 505px;
  padding: 20px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: #050505;
  color: #d4ced0;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  line-height: 1.9;
  caret-color: var(--red-bright);
}

.favorites-grid { display: grid; margin-top: 24px; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.favorite-card {
  position: relative;
  min-height: 145px;
  padding: 18px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-align: left;
  transition: .2s ease;
}
.favorite-card:hover { transform: translateY(-2px); border-color: rgba(220,23,53,.3); }
.favorite-card .tag { display: inline-block; margin-bottom: 24px; padding: 4px 7px; border: 1px solid rgba(220,23,53,.17); border-radius: 10px; background: var(--red-soft); color: var(--red-bright); font-size: 7px; text-transform: uppercase; letter-spacing: .1em; }
.favorite-card strong { display: block; font-family: "Chakra Petch", sans-serif; font-size: 16px; font-weight: 600; }
.favorite-card small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 8px; }

.command-palette { position: fixed; inset: 0; z-index: 100; display: none; place-items: start center; padding-top: 10vh; }
.command-palette.is-open { display: grid; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(12px); }
.palette-panel { position: relative; width: min(650px, calc(100vw - 30px)); max-height: 70vh; overflow: hidden; border: 1px solid rgba(220,23,53,.25); border-radius: 15px; background: #090909; box-shadow: 0 30px 100px rgba(0,0,0,.7), 0 0 50px rgba(220,23,53,.08); animation: palette-in .2s ease both; }
@keyframes palette-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.palette-search { display: flex; height: 58px; padding: 0 15px; gap: 11px; align-items: center; border-bottom: 1px solid var(--line); color: var(--red-bright); }
.palette-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #fff; font-size: 13px; }
.palette-results { max-height: calc(70vh - 58px); padding: 7px; overflow-y: auto; }
.palette-result {
  display: grid;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  cursor: pointer;
  grid-template-columns: 31px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.palette-result:hover { border-color: rgba(220,23,53,.18); background: var(--red-soft); }
.palette-result .doc-symbol { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; background: #111; color: var(--red-bright); font-family: "Chakra Petch", sans-serif; font-size: 11px; }

.dynamic-builder { margin-bottom: 17px; padding: 17px; border: 1px solid rgba(220,23,53,.18); border-radius: 12px; background: linear-gradient(135deg,rgba(220,23,53,.065),rgba(255,255,255,.012)); }
.wan-builder { margin-bottom: 17px; padding: 17px; border: 1px solid rgba(240,198,107,.24); border-radius: 12px; background: linear-gradient(135deg,rgba(240,198,107,.065),rgba(220,23,53,.035)); }
.wan-step { display: grid; margin-bottom: 13px; padding: 12px; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(8,8,8,.55); }
.wan-step > b { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red-bright); }
.wan-step strong, .wan-step code { display: block; }
.wan-step strong { margin-bottom: 4px; font-size: 9px; }
.wan-step code { color: #ffad91; font: 8px/1.6 "JetBrains Mono",monospace; overflow-wrap: anywhere; }
.wan-fields { display: grid; margin-bottom: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.dynamic-builder-head { display:flex; margin-bottom:14px; gap:12px; align-items:flex-end; justify-content:space-between; }
.dynamic-builder-head h2 { margin:0 0 3px; font-size:14px; letter-spacing:.06em; text-transform:uppercase; }
.dynamic-builder-head p { margin:0; color:var(--muted-2); font-size:8px; }
.dynamic-form { display:grid; grid-template-columns: 1.1fr 1fr 1fr auto; gap:8px; align-items:end; }
.dynamic-form .form-field input,.dynamic-form .form-field select { height:35px; }
.dynamic-output { display:grid; margin-top:12px; grid-template-columns:1fr auto; gap:8px; align-items:stretch; }
.dynamic-output code { min-height:42px; padding:11px; overflow-wrap:anywhere; border:1px solid var(--line); border-radius:8px; background:#050505; color:#e17a8d; font:9px/1.8 "JetBrains Mono",monospace; }
.dynamic-help { margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(209,122,83,.18); border-radius: 8px; color: var(--muted); font-size: 8px; line-height: 1.7; }
.dynamic-help strong { color: var(--ivory); }
.dynamic-help p { margin: 3px 0 0; }
.ams-access { margin-bottom: 14px; padding: 16px; border: 1px solid rgba(209,122,83,.24); border-radius: 13px; background: linear-gradient(135deg,rgba(209,122,83,.08),rgba(173,48,73,.045)); }
.ams-access-head, .ams-access-head > div, .access-switch, .access-search { display: flex; align-items: center; }
.ams-access-head { margin-bottom: 11px; gap: 12px; justify-content: space-between; }
.ams-access-head > div { gap: 10px; }
.ams-access-head strong, .ams-access-head small { display: block; }
.ams-access-head strong { color: var(--ivory); font-size: 11px; }
.ams-access-head small { margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.access-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.access-meta span { padding: 4px 7px; border: 1px solid rgba(255,255,255,.07); border-radius: 6px; color: var(--muted-2); font-size: 7px; }
.protected-secret { display: grid; gap: 5px; }
.access-lens { width: 30px; height: 30px; color: var(--red-bright); filter: drop-shadow(0 0 9px rgba(227,66,45,.4)); }
.access-switch { gap: 7px; color: var(--muted); font-size: 8px; cursor: pointer; }
.access-switch input { position: absolute; opacity: 0; pointer-events: none; }
.access-switch span { position: relative; width: 29px; height: 16px; border: 1px solid var(--line-strong); border-radius: 20px; background: #1b171a; }
.access-switch span::after { position: absolute; left: 3px; top: 3px; width: 8px; height: 8px; content: ""; border-radius: 50%; background: var(--muted-2); transition: .2s ease; }
.access-switch input:checked + span { border-color: rgba(227,66,45,.5); background: var(--red-soft); }
.access-switch input:checked + span::after { left: 16px; background: var(--red-bright); box-shadow: 0 0 8px rgba(227,66,45,.5); }
.access-search { height: 40px; padding: 0 11px; gap: 8px; border: 1px solid rgba(209,122,83,.3); border-radius: 9px; background: #181316; color: var(--copper); }
.access-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 10px; }
.access-results { display: grid; margin-top: 10px; gap: 7px; }
.access-results > p { margin: 3px 0 0; color: var(--muted-2); font-size: 8px; }
.access-card { display: grid; padding: 10px; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(12,10,12,.5); }
.access-card strong, .access-card small { display: block; }
.access-card strong { font-size: 9px; }
.access-card small, .access-card p { color: var(--muted-2); font-size: 7px; }
.access-card p { margin: 3px 0 0; }
.protected-secret { display: grid; min-width: 180px; gap: 4px; justify-items: end; }
.protected-secret > div { display: flex; gap: 5px; }
.protected-secret span { color: var(--copper); font-size: 7px; text-transform: uppercase; letter-spacing: .08em; }
.protected-secret code { color: var(--red-bright); font: 9px "JetBrains Mono", monospace; }
.finance-tabs { display: flex; margin-bottom: 14px; padding: 5px; gap: 5px; border: 1px solid var(--line); border-radius: 11px; background: rgba(23,19,22,.76); }
.finance-tabs button { min-height: 32px; padding: 0 12px; cursor: pointer; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 9px; }
.finance-tabs button.is-active { border-color: rgba(227,66,45,.26); background: var(--red-soft); color: var(--text); }
.palette-result strong { display: block; font-size: 9px; }
.palette-result small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.palette-result > small { padding: 3px 6px; border: 1px solid var(--line); border-radius: 10px; text-transform: uppercase; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 8px; }
.toast {
  display: flex;
  min-width: 230px;
  padding: 11px 13px;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(220,23,53,.25);
  border-radius: 10px;
  background: rgba(12,10,11,.94);
  color: #d9d3d5;
  box-shadow: 0 16px 50px rgba(0,0,0,.45);
  font-size: 9px;
  animation: toast-in .25s ease both;
}
.toast span { color: var(--red-bright); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.document-resources {
  display: flex;
  padding: 10px 18px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(209,122,83,.09), rgba(173,48,73,.05));
}
.document-resources > div { min-width: 180px; margin-right: auto; }
.document-resources strong, .document-resources small { display: block; }
.document-resources strong { color: var(--ivory); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.document-resources small { margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.resource-link {
  display: inline-flex;
  min-height: 30px;
  padding: 0 10px;
  gap: 6px;
  align-items: center;
  border: 1px solid rgba(209,122,83,.27);
  border-radius: 8px;
  background: rgba(209,122,83,.07);
  color: var(--ivory);
  font-size: 8px;
  text-decoration: none;
}
.resource-link:hover { border-color: var(--copper); background: rgba(209,122,83,.14); }
.resource-link span { color: var(--red-bright); }
.telephony-media { padding: 14px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg,rgba(173,48,73,.07),rgba(209,122,83,.035)); }
.telephony-media > header { display: flex; margin-bottom: 12px; gap: 12px; align-items: center; justify-content: space-between; }
.telephony-media header strong, .telephony-media header small { display: block; }
.telephony-media header strong { color: var(--ivory); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.telephony-media header small { margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.telephony-media header aside { max-width: 330px; padding: 8px 10px; border: 1px solid rgba(209,122,83,.22); border-radius: 8px; color: var(--muted); font-size: 8px; }
.telephony-media header aside b, .telephony-media header aside span { display: block; }
.telephony-media header aside b { margin-bottom: 2px; color: var(--copper); }
.telephony-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.video-card { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #151215; }
.video-card > strong { display: block; padding: 8px 9px; color: #d8cdca; font-size: 8px; letter-spacing: .04em; }
.video-frame { position: relative; padding-top: 56.25%; background: #090709; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* V4.4: grafite quente, escarlate, vinho e cobre. */
.global-search, .icon-button, .profile-button, .source-pill,
.ghost-button, .small-button, .filter-button, .stat-card, .recent-card {
  background-color: rgba(255,244,239,.035);
}
.library-sidebar, .document-panel, .command-sidebar, .command-panel,
.air-form, .air-preview, .calculator-menu, .calculator-workspace {
  background: rgba(23,19,22,.9);
  box-shadow: 0 18px 55px rgba(0,0,0,.28);
}
.inline-search, .insert-chip, .command-card, .calc-tab .calc-symbol,
.form-field input, .form-field select, .form-field textarea,
.calc-formula, .calc-mask, .air-output, .dynamic-output code {
  background: #1c171a;
}
.command-card:hover { background: #26191d; }
.calc-result-card {
  background: linear-gradient(140deg, rgba(227,66,45,.12), rgba(26,20,23,.96));
}
.palette-panel { background: #171215; }
.primary-button {
  border-color: var(--red);
  background: linear-gradient(135deg, var(--red), var(--wine));
  box-shadow: 0 8px 24px rgba(227,66,45,.24);
}
.primary-button:hover { background: linear-gradient(135deg, var(--red-bright), var(--red-deep)); }
.page-title em, .page-eyebrow, .document-title-wrap .crumb,
.command-card code, .dynamic-output code { color: var(--red-bright); }
.stat-card::after, .quick-card::after { background: linear-gradient(90deg, var(--red), var(--copper)); }
.quick-card:hover, .recent-card:hover {
  border-color: rgba(209,122,83,.32);
  background: linear-gradient(145deg, rgba(227,66,45,.09), rgba(209,122,83,.035));
}

/* V4.9: busca AMS de alto contraste e base técnica. */
.command-sidebar {
  border-color: rgba(209,122,83,.2);
  background: linear-gradient(180deg, rgba(35,27,31,.98), rgba(19,16,19,.96));
}
.command-sidebar .library-header {
  background: linear-gradient(145deg, rgba(227,66,45,.12), rgba(209,122,83,.035));
}
.command-sidebar .inline-search {
  height: 42px;
  border-color: rgba(255,112,72,.38);
  background: rgba(11,8,10,.72);
  color: var(--red-bright);
  box-shadow: inset 0 0 0 1px rgba(255,112,72,.04), 0 8px 24px rgba(0,0,0,.2);
}
.command-sidebar .inline-search input { font-size: 11px; }
.command-category { min-height: 43px; font-size: 10px; }
.command-category:hover, .command-category.is-active {
  border-color: rgba(255,112,72,.3);
  background: linear-gradient(90deg, rgba(227,66,45,.18), rgba(209,122,83,.04));
}
.command-panel {
  border-color: rgba(209,122,83,.14);
  background: linear-gradient(155deg, rgba(32,25,29,.96), rgba(20,17,20,.96));
}
.command-base-pill {
  padding: 6px 9px;
  border: 1px solid rgba(89,213,156,.24);
  border-radius: 20px;
  background: rgba(89,213,156,.055);
  color: var(--green);
  font-size: 7px;
  letter-spacing: .12em;
}
.command-section-title {
  display: flex;
  margin: 19px 0 10px;
  align-items: center;
  justify-content: space-between;
}
.command-section-title > div { display: flex; gap: 8px; align-items: center; }
.command-section-title [data-icon] { color: var(--red-bright); }
.command-section-title strong { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.command-section-title small { color: var(--muted-2); font-size: 8px; }
.command-card {
  padding: 16px;
  border-color: rgba(255,232,224,.13);
  background: linear-gradient(145deg, rgba(39,31,35,.94), rgba(24,20,23,.96));
}
.command-card strong { color: var(--ivory); font-size: 10px; }
.command-card code { color: #ff977b; font-size: 10px; }
.command-copy { border-color: rgba(255,112,72,.25); background: rgba(227,66,45,.1); color: var(--red-bright); }

.ams-access {
  margin-bottom: 20px;
  padding: 21px;
  border-color: rgba(255,112,72,.42);
  background:
    radial-gradient(circle at 100% 0%, rgba(227,66,45,.2), transparent 38%),
    linear-gradient(140deg, rgba(54,36,43,.97), rgba(27,21,25,.98));
  box-shadow: 0 18px 46px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.035);
}
.ams-access-head { margin-bottom: 15px; }
.ams-access-head > div { align-items: center; }
.access-eyebrow { display: block; margin-bottom: 3px; color: var(--red-bright); font-size: 7px; font-weight: 700; letter-spacing: .18em; }
.ams-access-head strong { color: #fff7f2; font-size: 15px; letter-spacing: .035em; }
.ams-access-head small { color: #c3aaa5; font-size: 9px; }
.access-lens {
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid rgba(255,112,72,.32);
  border-radius: 12px;
  background: rgba(227,66,45,.12);
}
.access-switch {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: #d4c3bf;
  font-size: 9px;
}
.access-search {
  height: 54px;
  padding: 0 14px;
  border-color: rgba(255,112,72,.55);
  border-radius: 12px;
  background: rgba(12,8,11,.76);
  box-shadow: 0 0 0 3px rgba(227,66,45,.05);
}
.access-search:focus-within { border-color: var(--red-bright); box-shadow: 0 0 0 3px rgba(227,66,45,.12), 0 10px 28px rgba(0,0,0,.25); }
.access-search [data-icon] { width: 21px; height: 21px; color: var(--red-bright); }
.access-search input { font-size: 12px; }
.access-search kbd { padding: 4px 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; color: var(--muted); font: 7px "JetBrains Mono", monospace; }
.access-connection {
  display: flex;
  min-height: 26px;
  margin-top: 8px;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 8px;
}
.access-connection span {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 8px rgba(131,117,114,.4);
}
.access-connection.is-loading span { background: var(--yellow); box-shadow: 0 0 9px rgba(240,198,107,.7); }
.access-connection.is-connected { color: #a9dec8; }
.access-connection.is-connected span { background: var(--green); box-shadow: 0 0 9px rgba(89,213,156,.7); }
.access-connection.is-error { color: #ff9b86; }
.access-connection.is-error span { background: var(--red-bright); box-shadow: 0 0 9px rgba(255,112,72,.7); }
.access-results { gap: 9px; }
.access-results > p { padding: 9px 0 2px; color: #bca9a5; font-size: 9px; }
.access-loading::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--red-bright); border-radius: 50%; vertical-align: middle; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.access-card {
  min-height: 82px;
  padding: 13px 14px;
  border-color: rgba(255,232,224,.14);
  border-radius: 11px;
  background: rgba(14,10,13,.68);
}
.access-model-label { display: block; margin-bottom: 4px; color: var(--red-bright); font-size: 7px; letter-spacing: .15em; }
.access-card strong { color: #fff; font-size: 11px; }
.access-card small { margin-top: 4px; color: #bba8a4; font-size: 8px; }
.protected-secret { min-width: 220px; }
.protected-secret code { color: #ff9b7e; font-size: 11px; }
.protected-secret .access-reveal { border-color: rgba(255,112,72,.32); color: #ffd9ce; }

.network-tools {
  display: grid;
  margin: 24px 0 17px;
  gap: 10px;
}
.network-search {
  display: flex;
  height: 50px;
  padding: 0 14px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,112,72,.35);
  border-radius: 12px;
  background: rgba(31,24,28,.88);
  color: var(--red-bright);
}
.network-search:focus-within { border-color: var(--red-bright); box-shadow: 0 0 0 3px rgba(227,66,45,.08); }
.network-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.network-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.network-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.network-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(38,30,34,.95), rgba(22,18,21,.96));
  box-shadow: 0 14px 36px rgba(0,0,0,.18);
}
.network-card header { display: flex; margin-bottom: 12px; gap: 10px; align-items: center; }
.network-card header > span { width: 34px; height: 34px; padding: 7px; flex: 0 0 auto; border: 1px solid rgba(255,112,72,.24); border-radius: 9px; background: rgba(227,66,45,.09); color: var(--red-bright); }
.network-card header small, .network-card header strong { display: block; }
.network-card header small { margin-bottom: 3px; color: var(--copper); font-size: 7px; letter-spacing: .12em; text-transform: uppercase; }
.network-card header strong { color: var(--ivory); font-size: 12px; }
.network-card p { min-height: 80px; margin: 0; color: #c4b8b5; font-size: 9px; line-height: 1.7; }
.network-card > div { margin-top: 13px; padding: 10px; border: 1px solid rgba(209,122,83,.15); border-radius: 8px; background: rgba(209,122,83,.045); }
.network-card b, .network-card > div span { display: block; }
.network-card b { margin-bottom: 4px; color: var(--copper); font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.network-card > div span { color: var(--muted); font-size: 8px; line-height: 1.65; }

/* V5.0: contraste, rasgo binário e termos. */
:root {
  --bg: #100d11;
  --panel: #221b20;
  --panel-2: #2a2026;
  --panel-3: #34252c;
  --line: rgba(255, 235, 228, .18);
  --line-strong: rgba(255, 235, 228, .29);
  --muted: #d2c1bc;
  --muted-2: #ac9590;
  --red: #e84e34;
  --red-bright: #ff8a60;
  --red-deep: #922a3d;
  --wine: #bb3950;
  --copper: #e0946b;
  --ivory: #ffe8dc;
}
body {
  background:
    radial-gradient(circle at 100% 0%, rgba(185,54,77,.3), transparent 34%),
    radial-gradient(circle at 20% 100%, rgba(224,148,107,.14), transparent 35%),
    linear-gradient(145deg, #100d11 0%, #191319 55%, #110d11 100%);
}
.sidebar {
  border-right-color: rgba(255,235,228,.2);
  background: linear-gradient(180deg, rgba(31,24,29,.98), rgba(18,14,18,.98));
}
.topbar {
  border-bottom-color: rgba(255,235,228,.18);
  background: rgba(27,21,26,.91);
}
.nav-label { color: #b39892; }
.nav-item { color: #d1bfba; }
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.is-active {
  border-color: rgba(255,138,96,.3);
  background: linear-gradient(90deg, rgba(232,78,52,.24), rgba(187,57,80,.08));
}
.library-sidebar, .document-panel, .command-sidebar, .command-panel,
.air-form, .air-preview, .calculator-menu, .calculator-workspace {
  border-color: rgba(255,235,228,.19);
  background: linear-gradient(155deg, rgba(45,34,41,.97), rgba(29,23,28,.98));
  box-shadow: 0 20px 58px rgba(0,0,0,.32);
}
.library-header, .document-top, .editor-toolbar { border-color: rgba(255,235,228,.18); }
.inline-search, .global-search, .network-search,
.form-field input, .form-field select, .form-field textarea {
  border-color: rgba(255,235,228,.2);
  background: rgba(18,13,17,.68);
}
input::placeholder, textarea::placeholder { color: #a9908a; opacity: 1; }
.doc-list-button { color: #d9cac6; }
.doc-list-button:hover { background: rgba(255,255,255,.055); }
.doc-list-button.is-active {
  border-color: rgba(255,138,96,.32);
  background: linear-gradient(90deg, rgba(232,78,52,.21), rgba(224,148,107,.055));
}
.mask-card {
  border-color: rgba(255,235,228,.2);
  background: linear-gradient(145deg, rgba(54,41,48,.98), rgba(34,27,32,.99));
}
.mask-card-head { background: linear-gradient(90deg, rgba(232,78,52,.16), rgba(224,148,107,.055)); }
.mask-card-head span, .mask-card-tools small { font-size: 8px; }
.mask-card-head strong { font-size: 11px; }
.mask-content { color: #f0e3df; font-size: 11px; line-height: 2.05; }
.mask-input {
  border-color: rgba(255,138,96,.32);
  background: rgba(15,10,14,.76);
  color: #fff8f4;
}
.command-card {
  border-color: rgba(255,235,228,.2);
  background: linear-gradient(145deg, rgba(55,41,48,.97), rgba(33,26,31,.98));
}
.command-card strong { color: #fff0e8; font-size: 11px; }
.command-card code { color: #ffad91; font-size: 10px; }
.command-info div, .safety-note { color: #d2c1bc; }
.access-card {
  border-color: rgba(255,235,228,.2);
  background: rgba(29,20,26,.82);
}
.access-meta { color: #d6c3be; }
.protected-secret code { color: #ffb095; }

.time-rift {
  position: fixed;
  top: 18%;
  right: 6px;
  z-index: 0;
  width: 88px;
  height: 320px;
  overflow: hidden;
  pointer-events: none;
  opacity: .88;
  clip-path: polygon(56% 0, 86% 8%, 68% 25%, 91% 41%, 63% 57%, 80% 73%, 45% 100%, 35% 76%, 12% 61%, 36% 43%, 10% 27%, 42% 13%);
  filter: drop-shadow(0 0 12px rgba(255,67,55,.48)) drop-shadow(0 0 26px rgba(165,43,76,.28));
}
.app-shell { position: relative; z-index: 1; }

@media (max-width: 560px) {
  .brand-mark { width: 48px; height: 48px; }
}
.time-rift::before, .time-rift::after {
  position: absolute;
  inset: 0;
  content: "";
}
.time-rift::before {
  background:
    radial-gradient(ellipse at center, rgba(255,126,85,.42), transparent 38%),
    linear-gradient(90deg, transparent 28%, rgba(6,4,8,.98) 43%, #020104 52%, rgba(6,4,8,.98) 61%, transparent 76%);
}
.time-rift::after {
  inset: 4px 16px;
  border-left: 1px solid rgba(255,159,119,.82);
  border-right: 1px solid rgba(255,73,68,.65);
  filter: blur(.3px);
}
.time-rift span {
  position: absolute;
  top: -75px;
  left: calc(20px + var(--rift-x, 0px));
  color: #ffb095;
  font: 600 7px/1 "JetBrains Mono", monospace;
  letter-spacing: .14em;
  writing-mode: vertical-rl;
  text-shadow: 0 0 8px #ff533e;
  animation: binary-fall 5s linear infinite;
}
.time-rift span:nth-child(2) { --rift-x: 12px; animation-delay: -.8s; animation-duration: 4.2s; }
.time-rift span:nth-child(3) { --rift-x: 25px; animation-delay: -2.1s; animation-duration: 5.8s; }
.time-rift span:nth-child(4) { --rift-x: 38px; animation-delay: -3.2s; animation-duration: 4.7s; }
.time-rift span:nth-child(5) { --rift-x: 7px; animation-delay: -4.1s; animation-duration: 6.1s; }
.time-rift span:nth-child(6) { --rift-x: 31px; animation-delay: -1.5s; animation-duration: 5.1s; }
.time-rift span:nth-child(7) { --rift-x: 18px; animation-delay: -3.8s; animation-duration: 4.5s; }
.time-rift span:nth-child(8) { --rift-x: 43px; animation-delay: -2.7s; animation-duration: 5.5s; }
@keyframes binary-fall {
  0% { transform: translateY(-30px); opacity: 0; }
  12% { opacity: .9; }
  85% { opacity: .75; }
  100% { transform: translateY(410px); opacity: 0; }
}

.legal-grid {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.legal-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(54,41,48,.96), rgba(31,24,29,.98));
  box-shadow: 0 16px 42px rgba(0,0,0,.22);
}
.legal-card header { display: flex; gap: 10px; align-items: center; }
.legal-card header span { width: 32px; height: 32px; padding: 7px; border: 1px solid rgba(255,138,96,.28); border-radius: 9px; background: rgba(232,78,52,.12); color: var(--red-bright); }
.legal-card strong { color: var(--ivory); font-size: 13px; }
.legal-card p { margin: 13px 0 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.security-flow { display: grid; margin-top: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.security-step { display: flex; padding: 15px; gap: 10px; border: 1px solid rgba(224,148,107,.2); border-radius: 12px; background: rgba(224,148,107,.055); }
.security-step > span { color: var(--red-bright); font: 600 12px "JetBrains Mono", monospace; }
.security-step strong { display: block; color: var(--ivory); font-size: 10px; }
.security-step p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.security-step code { color: var(--red-bright); font: 8px "JetBrains Mono", monospace; }
.legal-note { margin: 14px 0 0; padding: 13px 15px; border-left: 2px solid var(--red); background: rgba(232,78,52,.06); color: var(--muted); font-size: 9px; }

@media (max-width: 1180px) {
  .stats-grid, .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .favorites-grid { grid-template-columns: repeat(2, 1fr); }
  .command-grid { grid-template-columns: 1fr; }
  .air-layout,.calculator-shell { grid-template-columns: 1fr; }
  .hero-wing { opacity: .14; right: -25px; }
  .telephony-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .network-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .security-flow { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --sidebar: 232px; }
  .sidebar { transform: translateX(-102%); transition: transform .25s ease; box-shadow: 20px 0 70px rgba(0,0,0,.65); }
  .sidebar.is-open { transform: translateX(0); }
  .app-shell { margin-left: 0; }
  .mobile-menu { display: inline-flex; flex: 0 0 auto; }
  .topbar { height: 66px; padding: 0 13px; gap: 8px; }
  .global-search { width: 100%; }
  .source-pill, .profile-button, #backupButton, .global-search kbd { display: none; }
  .main-content { min-height: calc(100vh - 66px); padding: 18px 13px; }
  .library-layout, .commands-layout { height: auto; grid-template-columns: 1fr; }
  .library-sidebar, .command-sidebar { height: 310px; }
  .document-panel { min-height: 650px; }
  .command-panel { min-height: 600px; }
  .document-top { align-items: flex-start; }
  .document-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 560px) {
  .hero { min-height: 270px; padding: 25px 21px; }
  .stats-grid, .quick-grid, .recent-grid, .favorites-grid, .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .document-top { display: block; }
  .document-actions { margin-top: 14px; justify-content: flex-start; }
  .document-title-wrap h2 { font-size: 17px; white-space: normal; }
  .editor-toolbar { overflow-x: auto; }
  .document-editor { padding: 20px 17px 50px; font-size: 11px; }
  .air-form, .air-preview, .command-panel,.calculator-workspace { padding: 15px; }
  .air-output { min-height: 430px; }
  .document-resources { align-items: flex-start; flex-direction: column; }
  .telephony-media > header { align-items: flex-start; flex-direction: column; }
  .telephony-grid { grid-template-columns: 1fr; }
  .editor-toolbar { align-items: flex-start; flex-direction: column; }
  .privacy-chip { margin-left: 0; }
  .mask-card-head { align-items: flex-start; flex-direction: column; }
  .mask-card-tools { width: 100%; justify-content: space-between; }
  .mask-input { width: min(100%, 240px); }
  .ams-access-head, .access-card { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .protected-secret { min-width: 0; justify-items: start; }
  .wan-fields { grid-template-columns: 1fr; }
  .wan-step { grid-template-columns: 28px 1fr; }
  .wan-step button { grid-column: 1 / -1; }
  .access-search kbd { display: none; }
  .network-grid { grid-template-columns: 1fr; }
  .network-card p { min-height: 0; }
  .legal-grid { grid-template-columns: 1fr; }
  .time-rift { right: -28px; opacity: .5; transform: scale(.72); transform-origin: right top; }
}

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

/* V5.4: efeitos atmosféricos ficam em uma camada exclusiva atrás da interface. */
html { background: #100d11; }
body {
  position: relative;
  isolation: isolate;
  background: transparent;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 100% 0%, rgba(185,54,77,.3), transparent 34%),
    radial-gradient(circle at 20% 100%, rgba(224,148,107,.14), transparent 35%),
    linear-gradient(145deg, #100d11 0%, #191319 55%, #110d11 100%);
}
.crimson-glow,
.time-rift {
  z-index: -1;
}
.time-rift {
  opacity: .55;
  filter: drop-shadow(0 0 18px rgba(255,67,55,.38)) drop-shadow(0 0 36px rgba(165,43,76,.2));
}
.app-shell { position: relative; z-index: 1; }
