/* LoopingBR Publisher — Studio Edition
   Direção: software editorial premium, grafite + azul luminoso.
   Inspirado nos princípios de unidade visual, hierarquia e microinteração do Taste Skill.
   Camada apenas visual: IDs, componentes e fluxos operacionais são preservados. */
:root {
  color-scheme: dark;
  --lb-canvas: #0a0e15;
  --lb-surface: #141c28;
  --lb-surface-2: #1a2634;
  --lb-surface-3: #223247;
  --lb-stroke: #34465d;
  --lb-stroke-soft: #293a4e;
  --lb-ink: #f5f8fd;
  --lb-copy: #d2dfed;
  --lb-muted: #a8b9ce;
  --lb-blue: #6caeff;
  --lb-blue-strong: #386fe8;
  --lb-green: #80d4b0;
  --lb-radius: 16px;
  --space-bg: var(--lb-canvas);
  --space-panel: var(--lb-surface);
  --space-raised: var(--lb-surface-2);
  --space-border: var(--lb-stroke);
  --space-text: var(--lb-ink);
  --space-muted: var(--lb-muted);
  --space-blue: var(--lb-blue-strong);
  --space-green: var(--lb-green);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--lb-canvas);
  color: var(--lb-ink);
}
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(ellipse 70% 38% at 50% -14%, rgba(69,119,185,.16), transparent 72%),
    linear-gradient(160deg, #0d121b, #0a0e15 58%, #0c1420);
  color: var(--lb-ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
body::before { opacity: .08; }
.layout { isolation: isolate; }
main { width: min(1160px, calc(100% - 64px)); padding: 28px 0 84px; }
h1,h2,h3,h4,.home-shortcut strong { letter-spacing: -.035em; }
a,.link,.side-link,.secondary-link { color: #9cc5ff; }
a:hover,.link:hover,.secondary-link:hover { color: #d6e8ff; }
::selection { background: #476dbb; color: #fff; }

/* Barra superior, estado das integrações e navegação. */
.app-bar {
  height: 66px;
  min-height: 66px;
  padding: 0 21px;
  margin-bottom: 18px;
  background: rgba(20,29,42,.9);
  border: 1px solid var(--lb-stroke);
  border-radius: var(--lb-radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.16);
  backdrop-filter: blur(16px);
}
.app-bar-brand { font-size: 15px; font-weight: 800; letter-spacing: -.04em; }
.brand-accent { color: var(--lb-blue); }
.app-step-badge {
  background: var(--lb-surface-3);
  border: 1px solid var(--lb-stroke);
  border-radius: 20px;
  color: #e2eafa;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
}
.menu-toggle,.quick-nav-link,.notification-bell {
  background: var(--lb-surface-2);
  border: 1px solid var(--lb-stroke-soft);
  color: var(--lb-copy);
  border-radius: 10px;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.menu-toggle:hover,.quick-nav-link:hover,.notification-bell:hover {
  background: var(--lb-surface-3);
  border-color: #5c7fa7;
  transform: translateY(-1px);
}
.quick-nav-link.active,.quick-nav-link[aria-current="page"] {
  background: #254874;
  border-color: #75abf2;
  color: #fff;
}
#app-sidebar {
  background: linear-gradient(180deg,#151f2d,#0e1520);
  border-right: 1px solid var(--lb-stroke);
}
#app-sidebar .side-brand-row { margin: 2px 0 10px; }
#app-sidebar .side-brand-row h1 { color: #eef5fd; line-height: 1.1; font-size: 20px; }
#app-sidebar .subtitle { color: #b1c4da; font-size: 10px; letter-spacing: .13em; }
#app-sidebar .nav-group { color: #94aac5; letter-spacing: .14em; }
#app-sidebar .side-nav { border-radius: 10px; color: #d0dff0; }
#app-sidebar .side-nav:hover { background: #24364b; }
#app-sidebar .side-nav.active {
  background: #254468;
  border: 1px solid #486c99;
  color: #fff;
  box-shadow: inset 3px 0 0 #83beff;
}
#app-sidebar .side-footer { border-color: var(--lb-stroke-soft); }
.account-avatar-trigger {
  background: #27415f;
  border-color: #648eb7;
}
.account-avatar-trigger:hover,.account-avatar-trigger[aria-expanded="true"] {
  border-color: #9bc9ff;
  box-shadow: 0 0 0 3px rgba(108,174,255,.18);
}
.account-menu,.notification-panel {
  background: #1b293b;
  border: 1px solid #4d6786;
  box-shadow: 0 22px 60px #0009;
}

.top-sticky {
  padding: 15px 20px;
  margin-bottom: 23px;
  background: rgba(19,28,41,.95);
  border: 1px solid var(--lb-stroke);
  border-radius: var(--lb-radius);
  box-shadow: none;
}
.top-status-heading strong { font-size: 14px; color: var(--lb-ink); }
.connection-summary { color: #b8cae0; line-height: 1.5; }
.connection-details { border-top-color: var(--lb-stroke-soft); }
#conn-toggle,.top-status-heading .small-action { background: var(--lb-surface-2); border-color: var(--lb-stroke); }
#conn-toggle:hover,.top-status-heading .small-action:hover { background: var(--lb-surface-3); }
.mini { background: #192638; border-color: #30445d; padding: 15px; }
.mini small { color: #a9c0da; font-size: 10px; letter-spacing: .07em; }
.mini strong { color: #f2f7ff; font-size: 15px; }
.publisher-repo-line { border-top-color: var(--lb-stroke-soft); }
.step-controller { margin: 16px 0 19px; }
.step-controller #step-label { font-size: 12px; color: #c8d9eb; }
.step-controller .step-arrow { border: 1px solid var(--lb-stroke); background: #1e2c3d; }
.step-controller>button.enabled { background: var(--lb-blue-strong); }
.step-controller>button:not(.enabled):disabled { background: #1a2635; }

/* Composição visual das áreas de trabalho. */
.section,.analytics-panel {
  background: rgba(20,29,42,.97);
  border: 1px solid var(--lb-stroke);
  border-radius: 20px;
  padding: clamp(21px,2.7vw,32px);
  box-shadow: 0 14px 45px rgba(0,0,0,.13);
  color: var(--lb-ink);
}
.section h3 { font-size: clamp(21px,2.3vw,26px); line-height: 1.2; }
.section h4,.analytics-panel h4 { color: var(--lb-ink); }
.section p.lead,.home-heading .lead,.history-top .lead { color: #bed0e4; }
.hint,.footer { color: #b2c1d3; line-height: 1.6; }
label { color: #d4e0ed; }
.step-kicker,.eyebrow { color: #9ec9ff; letter-spacing: .14em; }
.settings-block,.quick-checklist,.detail-hero,.research-shell {
  background: #1a283a;
  border-color: var(--lb-stroke);
  border-radius: 15px;
}
.settings-credits { background: #182536; border-color: var(--lb-stroke); }
.credits-person { background: #1b2b3d; border-color: var(--lb-stroke-soft); }
.account-panel,.studio-feature,.studio-notice,.drive-storage,.drive-selection,
.drive-upload-progress,.upload-recent,.ai-selected,.research-results,
.analytics-chart,.drive-auth-compact {
  background: #1b293b;
  border: 1px solid var(--lb-stroke-soft);
  border-radius: 13px;
  color: var(--lb-ink);
}
.account-panel h4,.studio-feature h4 { color: #ecf4ff; }
.notice { background: #1d3046; border-left-color: #82b5ef; color: #d1e4f9; }
.notice.error,.error { background: #482e37; border-left-color: #f19ba7; color: #ffe1e6; }
.notice.success,.success { background: #1b4238; border-left-color: var(--lb-green); color: #c7f6dc; }
.tag { background: #2b4059; color: #d6e5f5; }
.tag.ok { background: #1c4639; color: #bff5d9; }
.tag.warn { background: #4c3e2b; color: #f8dfb6; }

/* Controles claros e consistentes, sem tocar nas ações do JS. */
button {
  border-radius: 10px;
  transition: transform .17s ease, border-color .17s ease, background-color .17s ease, box-shadow .17s ease;
}
button:not(:disabled):active { transform: translateY(1px); }
button:not(:disabled):hover { filter: brightness(1.06); }
button:not(:disabled):focus-visible,a:focus-visible,input:focus-visible,
textarea:focus-visible,select:focus-visible,summary:focus-visible {
  outline: 2px solid #9dcaff;
  outline-offset: 3px;
}
button:disabled { opacity: .56; }
.secondary,.mode {
  background: #243449;
  border-color: #415773;
  color: #e2edfa;
}
.secondary:hover,.mode:hover { background: #304861; color: #fff; }
input,textarea,select {
  background: #101b2a;
  border: 1px solid #405672;
  border-radius: 10px;
  color: #f3f7ff;
  caret-color: #9ccaff;
}
input::placeholder,textarea::placeholder { color: #93a8bf; }
input:focus,textarea:focus,select:focus {
  border-color: #8fbeff;
  box-shadow: 0 0 0 3px rgba(102,164,243,.16);
}
input[type=checkbox] { accent-color: #6daaff; }
option { background: #152131; }
.divider { background: var(--lb-stroke-soft); }

/* Início: duas escolhas com hierarquia, não um catálogo de cartões. */
#step-home {
  max-width: 1060px;
  min-height: min(72vh,700px);
  background:
    radial-gradient(ellipse 65% 65% at 88% 4%,rgba(66,128,210,.17),transparent 77%),
    linear-gradient(142deg,#1c2a3d,#141d2b 72%);
  border-color: #465e7a;
  box-shadow: 0 22px 65px #0003;
}
#step-home .home-heading { align-items: flex-start; }
#step-home .home-heading h3 {
  max-width: 700px;
  font-size: clamp(33px,4.8vw,54px);
  line-height: 1.08;
  letter-spacing: -.055em;
}
#step-home .home-heading h3::before {
  content: "LOOPINGBR / ESTÚDIO";
  color: #9cc8fa;
  font-size: 10px;
  letter-spacing: .18em;
  font-weight: 800;
  margin-bottom: 20px;
}
#step-home .home-heading .lead { font-size: 15px; line-height: 1.8; max-width: 720px; }
.home-shortcuts { gap: 17px; margin: 29px 0 30px; }
#step-home .home-shortcut {
  min-height: 204px;
  border-radius: 16px;
  padding: 24px;
  background: #1c2a3b;
  border: 1px solid #3c536f;
  box-shadow: none;
}
#step-home .home-shortcut:first-child {
  background: linear-gradient(145deg,#254568,#20334b);
  border: 1px solid #668bb6;
}
#step-home .home-shortcut:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px #0003;
  border-color: #8bbcff;
}
#step-home .home-shortcut .home-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #5177a0;
  border-radius: 12px;
  background: #25466c;
  color: #c9e5ff;
}
#step-home .home-shortcut strong { font-size: 19px; letter-spacing: -.03em; }
#step-home .home-shortcut span:not(.home-icon) { font-size: 13px; line-height: 1.6; color: #c0d0e3; }
#step-home .home-shortcut em { margin-top: auto; color: #b8dbff; }
#step-home .home-line { border-top-color: #3e526c; padding-top: 22px; }
#step-home .home-line>div>strong { font-size: 15px; }

/* Chat editorial: visual de workspace, mensagens longas legíveis. */
#step-publish .mode-switch { background: #132030; border-color: #31465f; border-radius: 12px; }
#step-publish .mode { border: 0; border-radius: 9px; color: #c3d2e4; }
#step-publish .mode.active { background: #315a91; color: #fff; box-shadow: 0 2px 10px #0003; }
.chat-toolbar { gap: 14px; }
.chat-tab { background: #21344b; border-color: #374e68; border-radius: 10px; }
.chat-tab.active { background: #2e5078; border-color: #759bc9; }
.chat-tab>button { color: #deedfc; }
.chat-tab>button:hover { background: #3b5b7c; }
.chat-tab>button.close-tab { color: #c5d6ec; }
.new-tab { border-color: #3e5470; }
#step-publish .chat-window {
  height: clamp(390px,52vh,620px);
  background:
    radial-gradient(circle at 100% 0, rgba(42,77,117,.16), transparent 45%),
    #101b29;
  border: 1px solid #364d66;
  border-radius: 16px;
  padding: clamp(14px,2vw,23px);
  gap: 13px;
}
#step-publish .bubble {
  max-width: min(84%,780px);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.7;
  border-radius: 16px;
  box-shadow: 0 5px 15px #0002;
}
#step-publish .bubble.assistant { background: #243449; border: 1px solid #3d5571; color: #f0f7ff; border-bottom-left-radius: 5px; }
#step-publish .bubble.user { background: #3564a6; border: 1px solid #5d8bc8; color: white; border-bottom-right-radius: 5px; }
#step-publish .bubble.assistant strong { color: #fff; }
#step-publish .chat-line-heading { color: #cbe0ff; }
#step-publish .compose-shell {
  padding: 10px;
  background: #1b2a3b;
  border: 1px solid #4e6c8b;
  border-radius: 15px;
}
#step-publish .compose-shell:focus-within {
  border-color: #8fbeff;
  box-shadow: 0 0 0 3px rgba(99,163,243,.14);
}
#step-publish .compose-shell textarea { background: transparent; border: 0; }
#step-publish #ai-send,#step-publish #review,#step-complete.enabled {
  background: #3b75db;
  border: 1px solid #72a8f4;
  color: #fff;
}
#step-publish #ai-send:hover,#step-publish #review:hover,#step-complete.enabled:hover { background: #2e67cd; }
#step-publish #ai-review { background: #29415c; border-color: #4e6b8c; }
#step-publish .ai-selected { background: #1b2c3e; border-color: #3d536b; }
#step-publish .draft-status { border-radius: 10px; }

/* Uploads, histórico e métricas mantêm a mesma linguagem. */
.drive-dropzone {
  border: 1.5px dashed #6681a5;
  background: #162538;
  border-radius: 17px;
  transition: background .2s ease, border-color .2s ease;
}
.drive-dropzone:hover,.drive-dropzone:focus-visible,.drive-dropzone.dragover {
  background: #1d3753;
  border-color: #a5caff;
}
.drive-selection,.drive-upload-progress,.upload-recent { background: #192839; }
.upload-recent-toggle:hover { background: #2b4056; }
#step-accounts .setup-service { border-color: #3f5570; background: #1a283a; border-radius: 14px; }
.setup-service>summary:hover { background: #263951; }
.setup-service-content { background: #162436; border-top-color: #3c526d; }
.setup-service-index { background: #2c4767; color: #d8edff; }
.setup-service-name { color: #f0f6ff; }
.setup-service-name>small { color: #b6cbe4; }
.setup-service-state { background: #344b64; color: #dfebff; }
.setup-service-state.connected { background: #234d3e; color: #c4f3d8; }
.publication-item { background: #192637; border: 1px solid #334960; border-radius: 14px; }
.publication-item:hover { border-color: #54779e; }
.publication-thumb { background: #273b50; }
.publication-main>strong,.publication-detail summary { color: #eef4fe; }
.publication-meta,.publication-note { color: #b9cbe1; }
.publication-state { background: #334a64; color: #e3eaf4; }
.publication-state.uploaded,.publication-state.scheduled { background: #23503e; color: #c9f5dd; }
.publication-state.uncertain,.publication-state.unavailable { background: #51412b; color: #f5dab0; }
.history-filters button.active { background: #335e99; border-color: #6994c6; }
.detail-hero,.detail-meta div,.detail-description { background: #1b2b3e; border-color: #3f5570; }
.analytics-panel { background: #1c2c3e; }
.analytics-metric { background: #253d54; }
.analytics-metric span { color: #bfd0e3; }
.analytics-chart { background: #142334; }

/* Uso em telas menores: legibilidade e área de toque antes de ornamento. */
@media (max-width: 950px) {
  main { width: min(100% - 36px, 1160px); padding-top: 16px; }
  .app-bar { padding: 0 15px; }
  .section { padding: 23px; }
  #step-home { min-height: 0; }
}
@media (max-width: 700px) {
  main { width: calc(100% - 24px); padding-top: 10px; }
  .app-bar { height: 60px; min-height: 60px; border-radius: 13px; gap: 8px; padding: 0 11px; }
  .app-bar-brand { font-size: 13px; }
  .app-step-badge { display: none; }
  .app-quick-nav { gap: 3px; }
  .quick-nav-link { width: 32px; min-width: 32px; height: 34px; }
  #connection-status-panel { padding: 13px; margin-bottom: 17px; }
  .section,.analytics-panel { padding: 17px; border-radius: 15px; }
  #step-home .home-heading h3 { font-size: clamp(29px,8vw,40px); }
  #step-home .home-heading h3::before { font-size: 9px; }
  .home-shortcuts { grid-template-columns: 1fr; gap: 12px; }
  #step-home .home-shortcut { min-height: 155px; padding: 20px; }
  .chat-toolbar { gap: 7px; }
  #step-publish .chat-window { height: min(52vh,460px); padding: 12px; }
  #step-publish .bubble { max-width: 95%; padding: 12px 14px; }
  .chat-compose { flex-direction: column; }
  #step-publish .chat-compose button { width: 100%; min-height: 44px; }
  .two,.drive-upload-grid { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .app-quick-nav .quick-nav-link { width: 30px; min-width: 30px; padding: 3px; }
  .app-bar-brand { font-size: 12px; letter-spacing: -.03em; }
  #step-publish .chat-window { height: min(49vh,390px); }
  #step-home .home-heading h3 { font-size: 31px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  #step-home { animation: none; }
  #step-home .home-shortcut:hover { transform: none; }
}
