:root {
  color-scheme: light;
  font-family: Arial, "Segoe UI", sans-serif;
  --ink: #1b1b1d;
  --ink-soft: #5e5b58;
  --line: #dedbd7;
  --line-strong: #c8c3be;
  --panel: #ffffff;
  --workspace: #ecebea;
  --warm: #fffaf6;
  --orange: #ed5a2a;
  --orange-dark: #c94217;
  --orange-pale: #fff0e9;
  --shadow: 0 14px 40px rgba(31, 24, 19, 0.14);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--workspace); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.app-shell { height: 100%; min-width: 720px; display: grid; grid-template-rows: 58px 34px 68px minmax(0, 1fr) 26px; background: var(--panel); }

.titlebar { display: flex; align-items: center; gap: 22px; padding: 0 16px; border-bottom: 1px solid #ece9e6; background: #fff; }
.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand-mark { position: relative; width: 24px; height: 29px; display: inline-block; }
.brand-mark span:first-child { position: absolute; inset: 4px 4px 0 5px; background: var(--orange); border-radius: 60% 40% 52% 48% / 62% 45% 55% 38%; transform: rotate(9deg); }
.brand-mark span:last-child { position: absolute; width: 9px; height: 15px; left: 4px; top: 0; background: #ff9a55; border-radius: 80% 20% 65% 35%; transform: rotate(28deg); }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -1.1px; }
.brand-format { align-self: flex-start; margin-top: 14px; color: var(--orange); font-size: 9px; font-weight: 800; letter-spacing: .7px; }
.document-meta { min-width: 220px; display: grid; gap: 1px; }
.document-meta input { width: min(360px, 29vw); padding: 1px 3px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--ink); font-size: 15px; font-weight: 650; outline: none; }
.document-meta input:hover, .document-meta input:focus { border-color: var(--line); background: #fff; }
.save-status { padding-left: 4px; color: #8b8783; font-size: 11px; }
.title-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar-stack { display: flex; padding-left: 8px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; margin-left: -7px; border: 2px solid #fff; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 750; }
.avatar-a { background: #24262e; } .avatar-b { background: #457266; }
.button { height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 650; transition: 140ms ease; }
.button:hover { border-color: var(--line-strong); background: #f8f7f6; }
.button-primary { border-color: var(--orange); background: var(--orange); color: #fff; }
.button-primary:hover { border-color: var(--orange-dark); background: var(--orange-dark); }

.menubar { display: flex; align-items: center; gap: 4px; padding: 0 16px 0 153px; border-bottom: 1px solid var(--line); background: #fff; }
.menubar button { height: 100%; padding: 0 9px; border: 0; background: transparent; color: #5e5a56; cursor: pointer; font-size: 12px; }
.menubar button:nth-child(2) { color: var(--orange-dark); font-weight: 700; box-shadow: inset 0 -2px var(--orange); }
.menubar button:hover { background: #f6f4f2; color: var(--ink); }

.ribbon { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #fbfaf9; }
.ribbon-group { display: flex; align-items: center; gap: 4px; }
.ribbon-divider { width: 1px; height: 38px; background: var(--line); }
.ribbon-spacer { flex: 1; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.icon-button:hover { background: #eeeae6; }
.icon-button:disabled { opacity: .32; cursor: default; }
.tool-button { min-width: 54px; display: grid; place-items: center; gap: 3px; padding: 4px 7px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; font-size: 10px; color: #595550; }
.tool-button .icon { width: 21px; height: 21px; color: #312f2d; }
.tool-button:hover { background: #eeeae6; }
.format-tools { display: flex; align-items: center; gap: 3px; }
.select-wrap { position: relative; display: block; }
.select-wrap select { height: 30px; appearance: none; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: #4c4946; outline: none; font-size: 12px; }
.select-wrap > .icon { position: absolute; right: 6px; top: 6px; width: 16px; height: 16px; pointer-events: none; }
.font-family-wrap select { width: 108px; }.font-size-wrap select { width: 62px; }
.format-button { width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.format-button:hover, .format-button.is-active { background: #e8e4df; }
.format-button.italic { font-family: Georgia, serif; font-style: italic; }
.format-button.underline { text-decoration: underline; }
.color-control { width: 31px; height: 31px; display: grid; place-items: center; position: relative; border-radius: 4px; cursor: pointer; font-weight: 700; }
.color-control:hover { background: #eeeae6; }
.color-control input { position: absolute; width: 18px; height: 5px; bottom: 3px; left: 7px; padding: 0; border: 0; cursor: pointer; }
.ai-button { height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid #e6c4b5; border-radius: 5px; background: #fff7f2; color: #a93e17; cursor: pointer; font-size: 12px; font-weight: 700; }
.ai-button:hover { background: #ffece2; }

.workspace { min-height: 0; display: grid; grid-template-columns: 214px minmax(420px, 1fr) 246px; background: var(--workspace); }
.slide-rail { min-height: 0; display: grid; grid-template-rows: 42px minmax(0, 1fr) 41px; border-right: 1px solid var(--line); background: #f7f6f5; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 15px; color: #84807c; font-size: 10px; font-weight: 700; letter-spacing: .8px; }
.slide-list { overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; }
.slide-thumb-row { display: grid; grid-template-columns: 19px 1fr; gap: 5px; align-items: start; margin: 6px 0 13px; cursor: pointer; }
.slide-number { padding-top: 6px; color: #817d79; font-size: 10px; text-align: center; }
.slide-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 2px solid transparent; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.slide-thumb-row.is-active .slide-thumb { border-color: var(--orange); box-shadow: 0 0 0 1px rgba(237,90,42,.17), 0 4px 10px rgba(0,0,0,.08); }
.thumb-content { position: absolute; inset: 0; overflow: hidden; transform-origin: top left; pointer-events: none; }
.thumb-title { position: absolute; left: 9%; top: 24%; width: 72%; font-size: 8px; line-height: 1.05; font-weight: 800; color: var(--thumb-ink, #1b1b1d); }
.thumb-subtitle { position: absolute; left: 9%; top: 58%; width: 65%; font-size: 3.4px; line-height: 1.25; color: var(--thumb-soft, #6a625b); }
.thumb-accent { position: absolute; left: 0; top: 0; width: 4%; height: 100%; background: var(--thumb-accent, var(--orange)); }
.thumb-orb { position: absolute; width: 45px; height: 45px; right: -16px; top: -18px; border-radius: 50%; background: var(--thumb-accent, var(--orange)); opacity: .9; }
.rail-actions { display: flex; justify-content: flex-end; gap: 4px; padding: 4px 10px; border-top: 1px solid var(--line); }
.rail-actions button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 4px; cursor: pointer; }
.rail-actions button:hover { background: #e9e6e3; }
.rail-actions .icon { width: 16px; height: 16px; }

.stage { min-width: 0; min-height: 0; display: grid; grid-template-rows: 35px minmax(0, 1fr) 72px; }
.stage-topline { display: flex; align-items: center; justify-content: space-between; padding: 0 17px; color: #77736f; font-size: 11px; }
.zoom-control { display: flex; align-items: center; gap: 3px; }
.zoom-control button { width: 22px; height: 22px; border: 0; border-radius: 3px; background: transparent; cursor: pointer; color: #66615e; }
.zoom-control button:hover { background: #ddd9d5; }
#zoom-label { min-width: 36px; text-align: center; }
.canvas-wrap { min-height: 0; display: grid; place-items: center; overflow: auto; padding: 20px 28px 28px; }
.slide-canvas { position: relative; width: min(100%, 960px); aspect-ratio: 16 / 9; overflow: hidden; background: var(--warm); box-shadow: var(--shadow); transform: scale(var(--canvas-scale, 1)); transition: transform 120ms ease; transform-origin: center; user-select: none; }
.slide-canvas::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); }
.slide-element { position: absolute; outline: 0; user-select: none; }
.slide-element.is-selected { box-shadow: 0 0 0 1.5px #3478f6; }
.slide-element.is-selected::before, .slide-element.is-selected::after { content: ""; position: absolute; z-index: 3; width: 7px; height: 7px; border: 1px solid #3478f6; background: #fff; }
.slide-element.is-selected::before { left: -5px; top: -5px; }
.slide-element.is-selected::after { right: -5px; bottom: -5px; }
.text-element { min-width: 80px; min-height: 28px; white-space: pre-wrap; line-height: 1.04; cursor: move; }
.text-element[contenteditable="true"] { cursor: text; user-select: text; }
.shape-element { border-radius: 1px; cursor: move; }
.image-element { object-fit: cover; cursor: move; }
.speaker-notes { display: grid; grid-template-columns: 150px 1fr; align-items: start; gap: 8px; padding: 10px 16px; border-top: 1px solid #d8d4d0; background: #f8f7f6; }
.speaker-notes span { padding-top: 3px; color: #8b8782; font-size: 9px; font-weight: 700; letter-spacing: .7px; }
.speaker-notes textarea { width: 100%; height: 48px; resize: none; padding: 3px 7px; border: 0; background: transparent; color: #4f4b48; font-size: 12px; outline: none; }

.inspector { min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); background: #fff; }
.inspector-header { height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 15px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.inspector-section { padding: 15px; border-bottom: 1px solid #ece9e6; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; color: #4b4845; font-size: 11px; font-weight: 700; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--orange-dark); cursor: pointer; font-size: 10px; }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px 9px; }
.theme-tile { padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; font-size: 10px; color: #68635e; }
.theme-preview { display: block; position: relative; aspect-ratio: 16 / 9; margin-bottom: 4px; overflow: hidden; border: 1px solid #d6d2ce; background: #fff; }
.theme-tile.is-active .theme-preview { border: 2px solid var(--orange); }
.theme-preview i { position: absolute; left: 11%; top: 30%; width: 50%; height: 5px; background: currentColor; }
.theme-preview b { position: absolute; left: 11%; top: 52%; width: 33%; height: 3px; background: currentColor; opacity: .38; }
.theme-brasa { color: #1b1b1d; background: #fffaf6; }.theme-brasa::after { content:""; position:absolute; right:-11px; top:-14px; width:35px; height:35px; border-radius:50%; background:var(--orange); }
.theme-claro { color: #1e3958; background: #fff; }.theme-claro::after { content:""; position:absolute; inset:0 auto 0 0; width:5px; background:#e1a638; }
.theme-noite { color: #fff; background: #1b1b1d; }.theme-noite::after { content:""; position:absolute; right:0; top:0; width:7px; height:100%; background:#d54e2d; }
.theme-oceano { color: #062a3d; background: #e8f6f5; }.theme-oceano::after { content:""; position:absolute; right:-8px; bottom:-12px; width:42px; height:27px; border-radius:50%; background:#1c8e8d; }
.background-row { display: flex; gap: 8px; }
.background-swatch { width: 30px; height: 30px; padding: 0; border: 1px solid #d6d1cd; border-radius: 4px; cursor: pointer; }
.background-swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--orange); }
.bg-light { background:#fffaf6; }.bg-white { background:#fff; }.bg-dark { background:#1b1b1d; }.bg-orange { background:var(--orange); }
.color-picker { position: relative; display: grid; place-items: center; overflow: hidden; background: conic-gradient(#ed5a2a,#e7b63c,#3c9b7e,#3f70c5,#a14ca0,#ed5a2a); color:#fff; font-weight:800; }
.color-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }.color-picker span { text-shadow: 0 1px 3px #000; }
.full-width select { width: 100%; }
.inspector-tip { display: flex; gap: 9px; margin: 15px; padding: 12px; border-left: 3px solid var(--orange); background: #fff6f1; color: #5c514b; }
.inspector-tip .icon { flex: 0 0 auto; color: var(--orange-dark); }
.inspector-tip strong { font-size: 11px; }.inspector-tip p { margin: 3px 0 0; font-size: 10px; line-height: 1.4; }

.statusbar { display: flex; align-items: center; gap: 18px; padding: 0 12px; border-top: 1px solid var(--line); background: #fbfaf9; color: #84807c; font-size: 10px; }
.status-spacer { flex: 1; }.status-hint { color: #aaa5a0; }
.toast-region { position: fixed; right: 18px; bottom: 40px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 240px; padding: 11px 14px; border-left: 3px solid var(--orange); background: #242426; color: #fff; box-shadow: 0 9px 24px rgba(0,0,0,.25); font-size: 12px; animation: toast-in 180ms ease-out; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.presentation-overlay { position: fixed; z-index: 200; inset: 0; display: none; place-items: center; background: #111; }
.presentation-overlay.is-open { display: grid; }
.presentation-slide { position: relative; width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; overflow: hidden; background: #fff; }
.presentation-controls { position: absolute; left: 50%; bottom: 18px; display: flex; align-items: center; gap: 5px; transform: translateX(-50%); padding: 5px; border: 1px solid rgba(255,255,255,.16); border-radius: 5px; background: rgba(20,20,22,.76); color:#fff; opacity: .35; transition: opacity 160ms; }
.presentation-overlay:hover .presentation-controls { opacity: 1; }
.presentation-controls button { width: 34px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 23px; }
.presentation-controls button:hover { background: rgba(255,255,255,.13); }.presentation-controls span { min-width: 55px; text-align: center; font-size: 11px; }

.ai-popover { position: fixed; top: 145px; right: 14px; z-index: 150; width: 275px; padding: 8px; border: 1px solid #e3d6cf; border-radius: 7px; background: #fff; box-shadow: 0 16px 45px rgba(35,24,18,.2); }
.ai-popover-head { display:flex; align-items:center; gap:10px; padding:8px 8px 12px; border-bottom:1px solid #eee8e4; }
.spark-badge { width:32px; height:32px; display:grid; place-items:center; border-radius:50%; background:#ffede3; color:var(--orange-dark); }
.ai-popover-head div { display:grid; gap:2px; }.ai-popover-head strong { font-size:12px; }.ai-popover-head span { color:#8a817a; font-size:10px; }
.ai-popover > button { width:100%; padding:10px; border:0; border-radius:4px; background:#fff; cursor:pointer; text-align:left; font-size:12px; }
.ai-popover > button:hover { background:#fff4ed; color:var(--orange-dark); }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 190px minmax(420px, 1fr); }
  .inspector { display: none; }
  .format-tools { display: none; }
  .menubar { padding-left: 16px; }
}
@media (max-width: 820px) {
  .app-shell { min-width: 680px; }
  .workspace { grid-template-columns: 150px minmax(420px, 1fr); }
  .compact-hide, .status-hint, .avatar-stack { display: none; }
  .slide-rail { grid-template-rows: 42px minmax(0, 1fr) 41px; }
  .ribbon { gap: 4px; }.tool-button { min-width: 47px; }
  .document-meta { min-width: 160px; }.document-meta input { width: 180px; }
}

.app-shell[data-drive-locked] { display: none; }
.drive-project-lock:not([hidden]) { min-height: 100%; display: grid; align-content: center; justify-items: center; gap: 16px; background: var(--panel); color: var(--ink); padding: 24px; text-align: center; }
.drive-project-lock p { font-size: 1rem; margin: 0; }
.drive-project-lock [data-drive-lifecycle-actions] { flex-wrap: wrap; justify-content: center; align-items: center; }
.drive-project-lock [data-drive-lifecycle-actions]:empty, .drive-project-lock [data-drive-lifecycle-actions] p:empty { display: none; }
.drive-project-lock [data-drive-lifecycle-actions] p { flex-basis: 100%; }
.app-shell[data-drive-read-only] .menubar,
.app-shell[data-drive-read-only] .ribbon { visibility: hidden; }
.app-shell[data-drive-read-only] .rail-actions,
.app-shell[data-drive-read-only] .quick-access,
.app-shell[data-drive-read-only] #new-slide-button,
.app-shell[data-drive-read-only] #comment-button { visibility: hidden; }
.app-shell[data-drive-read-only] .inspector { visibility: hidden; }
