:root {
  --blue: #14508c; --blue-2: #eaf1f9;
  --accent: #14508c;
  --green: #188038; --green-2: #e6f4ea;
  --yellow: #f9ab00; --red: #d93025;
  --text: #202124; --muted: #5f6368; --border: #dadce0;
  --surface: #fff; --surface-2: #f8f9fa; --hover: #f1f3f4;
  --shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-lg: 0 4px 12px rgba(60,64,67,.25);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {   font-family: Arial, Helvetica, sans-serif; color: var(--text); background: var(--surface-2); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ---------- App bar / menu bar / toolbar ---------- */
.gapp { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 12px 0 12px; background: #fff; }
.gapp-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.gapp-icon svg { width: 30px; height: 30px; }
.gapp-titles { display: flex; flex-direction: column; min-width: 0; }
.gapp-titles .row1 { display: flex; align-items: center; gap: 8px; }
.gtitle { border: 1px solid transparent; border-radius: 4px; font-size: 18px; color: var(--text); padding: 2px 6px; min-width: 80px; max-width: 44vw; outline: none; background: transparent; font-family: inherit; }
.gtitle:hover { border-color: var(--border); }
.gtitle:focus { border-color: var(--blue); }
.gapp-static { font-size: 18px; color: var(--text); padding: 2px 4px; }
.gapp-sub { font-size: 12px; color: var(--muted); padding-left: 6px; }
.gspacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #444746; }
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.gbtn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--text); padding: 8px 18px; border-radius: 20px; font-size: 14px; font-weight: 500; font-family: inherit; }
.gbtn:hover { background: var(--hover); }
.gbtn.primary { background: #c2e7ff; border-color: transparent; color: #001d35; }
.gbtn.primary:hover { background: #a8dbfd; }
.gbtn svg { width: 18px; height: 18px; fill: currentColor; }
.gchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; color: var(--muted); font-size: 13px; background: #fff; cursor: pointer; }
.gchip:hover { background: var(--hover); }

.gmenubar { display: flex; align-items: center; gap: 2px; padding: 0 16px 6px; background: #fff; font-size: 14px; color: #444746; }
.gmenubar span { padding: 4px 8px; border-radius: 4px; cursor: default; }
.gmenubar span:hover { background: var(--hover); }

.gtoolbar { display: flex; align-items: center; gap: 2px; padding: 4px 12px; background: #fff; border-bottom: 1px solid var(--border); flex-wrap: wrap; min-height: 44px; }
.gtoolbar button, .gtoolbar .tbtn { border: none; background: none; border-radius: 4px; padding: 6px 8px; cursor: pointer; color: #444746; font-size: 13px; font-family: inherit; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.gtoolbar button:hover, .gtoolbar .tbtn:hover { background: var(--hover); }
.gtoolbar .sep { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
.gtoolbar select { border: 1px solid transparent; border-radius: 4px; background: none; padding: 5px 6px; font: inherit; font-size: 13px; color: #444746; }
.gtoolbar select:hover { border-color: var(--border); }

/* ---------- Waffle ---------- */
.gright { display: flex; align-items: center; gap: 6px; position: relative; }
.gwaffle-btn { color: var(--muted); }
.gwaffle-menu { display: none; position: absolute; top: 52px; right: 0; width: 320px; background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); padding: 14px; z-index: 90; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gwaffle-menu.open { display: grid; }
.gwaffle-account { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-size: 14px; color: var(--text); }
.gwaffle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.gwaffle-grid a,
.gwaffle-menu > a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border-radius: 14px; font-size: 12px; color: var(--text); text-decoration: none; }
.gwaffle-grid a:hover { background: var(--hover); }
.gw-ico { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.gw-ico svg { width: 26px; height: 26px; fill: currentColor; }
.gwaffle-sep { height: 1px; background: var(--border); margin: 12px 8px; }
.gwaffle-more { display: block; text-align: center; padding: 10px; color: var(--muted); font-size: 13px; }
.gwaffle-more:hover { background: var(--hover); border-radius: 10px; }
.gavatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 500; font-size: 15px; flex: none; }

/* ---------- Login ---------- */
.glogin-body { background: #fff; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.glogin-card { width: 400px; max-width: 92vw; padding: 48px 40px; border: 1px solid var(--border); border-radius: 28px; text-align: center; }
.glogin-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.glogin-logo svg { width: 48px; height: 48px; }
.glogin-card h1 { font-weight: 400; font-size: 24px; margin: 0 0 6px; }
.glogin-sub { color: var(--muted); margin: 0 0 28px; }
.gfield { margin-bottom: 14px; }
.gfield input { width: 100%; padding: 14px 15px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; font-family: inherit; }
.gfield input:focus { border-color: var(--blue); outline: 1px solid var(--blue); }
.glogin-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
.glogin-error { background: #fce8e6; color: #c5221f; border-radius: 8px; padding: 10px; font-size: 13px; margin-bottom: 16px; }

/* ---------- Docs ---------- */
body.docs { background: #f8f9fa; }
.docs-layout { display: flex; height: calc(100vh - 56px - 40px - 44px); }
.docs-outline { width: 0; overflow: hidden; border-right: 0; background: #fff; transition: width .15s; }
.docs-outline.open { width: 240px; border-right: 1px solid var(--border); overflow: auto; padding: 16px 8px; }
.docs-outline h3 { font-size: 13px; color: var(--muted); margin: 4px 10px 10px; font-weight: 500; }
.docs-outline a { display: block; padding: 6px 12px; border-radius: 6px; font-size: 13px; color: var(--text); }
.docs-outline a:hover { background: var(--hover); }
.docs-outline a.h2 { padding-left: 26px; color: var(--muted); }
.docs-canvas { flex: 1; overflow: auto; display: flex; justify-content: center; padding: 24px 16px 80px; }
.docs-page { width: 816px; max-width: 100%; min-height: 1056px; background: #fff; box-shadow: var(--shadow); padding: 96px 88px; outline: none; line-height: 1.6; font-size: 11pt; color: #202124; }
.docs-page h1 { font-size: 20pt; font-weight: 400; }
.docs-page h2 { font-size: 15pt; font-weight: 500; }
.docs-page blockquote { border-left: 3px solid var(--border); margin: .8em 0; padding: .1em 1em; color: var(--muted); }
.docs-status { text-align: center; color: var(--muted); font-size: 12px; padding: 8px; }

/* ---------- Sheets ---------- */
body.sheets { background: #fff; }
.sheets-formula { display: flex; align-items: center; gap: 6px; padding: 3px 10px; border-bottom: 1px solid var(--border); background: #fff; }
.sheets-cellref { min-width: 70px; text-align: center; color: #444746; font-size: 13px; }
.sheets-fx { color: #444746; font-style: italic; }
.sheets-formula input { flex: 1; border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px; font: inherit; font-size: 13px; }
.sheets-wrap { overflow: auto; height: calc(100vh - 56px - 44px - 34px - 34px); }
table.sheet-grid { border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.sheet-grid th, .sheet-grid td { border: 1px solid #e0e0e0; height: 22px; padding: 0; }
.sheet-grid th { background: #f8f9fa; color: #5f6368; font-weight: 400; text-align: center; font-size: 11px; position: sticky; top: 0; z-index: 2; min-width: 100px; }
.sheet-grid th.rowhead, .sheet-grid th.corner { position: sticky; left: 0; z-index: 3; width: 48px; min-width: 48px; }
.sheet-grid th.active-col { background: #e6f4ea; color: var(--green); }
.sheet-grid td { min-width: 100px; padding: 2px 6px; outline: none; overflow: hidden; white-space: nowrap; }
.sheet-grid td:focus { box-shadow: inset 0 0 0 2px var(--green); }
.sheets-tabs { display: flex; align-items: center; gap: 6px; height: 34px; border-top: 1px solid var(--border); padding: 0 12px; background: #f8f9fa; }
.sheets-tab { padding: 6px 14px; font-size: 13px; color: var(--green); font-weight: 500; border-bottom: 2px solid transparent; }
.sheets-tab.active { border-bottom-color: var(--green); background: #e6f4ea; border-radius: 4px 4px 0 0; }

/* ---------- Slides ---------- */
body.slides { background: #f8f9fa; }
.slides-layout { display: flex; height: calc(100vh - 56px - 44px - 44px); }
.slides-rail { width: 200px; overflow: auto; padding: 10px; background: #f8f9fa; border-right: 1px solid var(--border); }
.slide-thumb { width: 100%; aspect-ratio: 16/9; background: #fff; border: 1px solid var(--border); border-radius: 3px; margin-bottom: 10px; padding: 8px; font-size: 9px; color: #444; overflow: hidden; cursor: pointer; }
.slide-thumb.active { border: 2px solid var(--blue); }
.slide-thumb .tn { font-weight: 700; color: #174ea6; font-size: 11px; margin-bottom: 4px; }
.slides-center { flex: 1; display: flex; flex-direction: column; align-items: center; overflow: auto; padding: 12px; }
.slides-stage { position: relative; flex: none; }
.slide-canvas { width: 960px; height: 540px; transform-origin: top left; position: relative; overflow: hidden; box-shadow: var(--shadow); color: #202124; }
.se-rot { display: none; position: absolute; left: 50%; top: -22px; width: 14px; height: 14px; margin-left: -7px; background: #fff; border: 2px solid #1a73e8; border-radius: 50%; cursor: grab; z-index: 3; }
.se:hover .se-rot, .se.sel .se-rot { display: block; }
.slide-canvas .stitle { font-size: 34px; font-weight: 700; border: none; outline: none; background: transparent; color: inherit; padding: 4px; }
.slide-canvas .sbody { flex: 1; font-size: 18px; border: none; outline: none; resize: none; background: transparent; color: inherit; padding: 4px; font-family: inherit; }
.slides-notes { width: 880px; max-width: 100%; margin-top: 16px; border-top: 1px solid var(--border); }
.slides-notes textarea { width: 100%; border: none; outline: none; resize: vertical; min-height: 60px; padding: 12px 4px; font-size: 13px; color: var(--muted); background: transparent; font-family: inherit; }
.slides-side { width: 240px; background: #fff; border-left: 1px solid var(--border); overflow: auto; padding: 14px; }
.slides-side h4 { font-size: 13px; color: var(--muted); margin: 0 0 12px; font-weight: 500; }
.slides-side .card { background: #f8f9fa; border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; font-size: 12px; }
.see-all { position: fixed; right: 26px; bottom: 22px; }

/* ---------- Photos ---------- */
body.photos { background: #fff; }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; padding: 8px; }
.photo { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 2px; display: block; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo span { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px; color: #fff; font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }

/* ---------- Mail (Gmail) ---------- */
body.mail { background: #f6f8fc; }
.gmail-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.gmail-logo { display: flex; align-items: center; gap: 8px; font-size: 22px; color: #5f6368; font-family: Roboto, Arial; }
.gmail-logo svg { width: 30px; height: 30px; }
.gmail-search { flex: 1; max-width: 720px; display: flex; align-items: center; gap: 8px; background: #eaf1fb; border-radius: 24px; padding: 6px 10px; color: #5f6368; }
.gmail-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 15px; padding: 6px; font-family: inherit; }
.gmail-app { display: flex; height: calc(100vh - 64px); }
.gmail-side { width: 256px; padding: 8px 12px; overflow: auto; }
.gmail-compose { display: inline-flex; align-items: center; gap: 10px; background: #c2e7ff; color: #001d35; border: none; border-radius: 16px; padding: 12px 22px; font-size: 14px; font-weight: 500; cursor: pointer; margin-bottom: 14px; }
.gmail-compose:hover { box-shadow: var(--shadow); }
.gmail-nav a { display: flex; align-items: center; gap: 14px; padding: 7px 20px 7px 12px; border-radius: 0 16px 16px 0; color: #202124; font-size: 14px; }
.gmail-nav a.active { background: #d3e3fd; font-weight: 700; }
.gmail-nav a:hover { background: #e8eaed; }
.gmail-nav .label { font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 14px 12px 4px; }
.gmail-main { flex: 1; overflow: auto; background: #fff; border-radius: 16px 0 0 0; margin: 0 8px 0 0; }
.gmail-toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-bottom: 1px solid #f1f3f4; color: #444746; }
.gmail-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #f1f3f4; cursor: pointer; font-size: 13px; }
.gmail-row:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(60,64,67,.3); }
.gmail-row.unread { font-weight: 700; background: #fff; }
.gmail-row .from { width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.gmail-row .subj { width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.gmail-row .snip { flex: 1; color: #5f6368; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gmail-row .date { color: #5f6368; font-weight: 400; font-size: 12px; flex: none; }
.gmail-detail { padding: 24px; }
.gmail-compose-box { position: fixed; right: 24px; bottom: 0; width: 460px; background: #fff; border-radius: 10px 10px 0 0; box-shadow: var(--shadow-lg); z-index: 90; }
.gmail-compose-box .hd { background: #f2f6fc; color: #444746; padding: 10px 14px; border-radius: 10px 10px 0 0; font-size: 14px; display: flex; justify-content: space-between; }
.gmail-compose-box .bd { padding: 10px 14px 16px; }
.gmail-compose-box input, .gmail-compose-box textarea { border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 8px 2px; font-size: 14px; }
.gmail-compose-box textarea { border: none; min-height: 140px; }

/* ---------- Center pages ---------- */
.center-page { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: calc(100vh - 100px); padding: 40px; }
.center-page .big svg { width: 84px; height: 84px; }
.center-page h1 { font-weight: 400; font-size: 28px; }
.room-pill { display: inline-flex; align-items: center; gap: 12px; margin: 18px 0; padding: 12px 20px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.room-pill code { font-size: 18px; letter-spacing: 1px; font-family: Roboto, monospace; }

/* ---------- Home cards / empty ---------- */
.doc-list { max-width: 940px; margin: 0 auto; padding: 20px; }
.doc-list h2 { font-weight: 400; font-size: 16px; color: var(--text); margin: 18px 4px 12px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.doc-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.doc-card:hover { border-color: #bdc1c6; box-shadow: var(--shadow); }
.doc-card .top { height: 130px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); }
.doc-card .top svg { width: 46px; height: 46px; }
.doc-card .meta { padding: 10px 12px; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty svg { width: 72px; height: 72px; fill: var(--muted); opacity: .5; margin: 0 auto; }

/* ---------- Toasts ---------- */
.os-toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 999; }
.os-toast { background: #323232; color: #fff; padding: 12px 18px; border-radius: 6px; box-shadow: var(--shadow-lg); font-size: 14px; }
.os-toast.error { background: var(--red); }

@media (max-width: 760px) {
  .gapp-sub, .gmail-side, .slides-side { display: none; }
  .gmenubar { overflow-x: auto; }
  .docs-page { padding: 40px 22px; }
}

/* ---------- Login note ---------- */
.glogin-note { margin-top: 24px; font-size: 13px; color: var(--muted); }
.glogin-note a { color: var(--blue); font-weight: 500; }

/* ---------- Docs extras ---------- */
.docs-findbar { display: none; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.docs-findbar.open { display: flex; }
.docs-findbar input { width: 220px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.docs-wordcount { font-size: 12px; color: var(--muted); margin-left: auto; }
.docs-page.zoom-125 { transform: scale(1.25); transform-origin: top center; }
.docs-page.zoom-150 { transform: scale(1.5); transform-origin: top center; }
.color-pop { position: fixed; width: 0; height: 0; opacity: 0; border: none; padding: 0; }

/* ---------- Sheets formatting ---------- */
.sheet-grid td.fmt-b { font-weight: 700; }
.sheet-grid td.fmt-i { font-style: italic; }
.sheet-grid td.fmt-u { text-decoration: underline; }
.sheet-grid td.fmt-s { text-decoration: line-through; }
.sheet-grid td.fmt-center { text-align: center; }
.sheet-grid td.fmt-right { text-align: right; }

/* ---------- Slides present ---------- */
.present-overlay { position: fixed; inset: 0; background: #000; z-index: 200; display: none; align-items: center; justify-content: center; }
.present-overlay.open { display: flex; }
.present-slide { width: 90vw; max-width: 1280px; aspect-ratio: 16/9; background: #fff; color: #202124; padding: 6vh 7vw; display: flex; flex-direction: column; }
.present-slide h1 { font-size: 4vw; margin: 0 0 2vh; }
.present-slide .body { font-size: 2vw; white-space: pre-wrap; }
.present-hint { position: fixed; bottom: 16px; left: 0; right: 0; text-align: center; color: #aaa; font-size: 12px; }

/* ---------- Photos lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 200; display: none; align-items: center; justify-content: center; flex-direction: column; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 78vh; object-fit: contain; }
.lightbox .lb-bar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #fff; }
.lightbox .lb-bar .gspacer { flex: 1; }
.lightbox .lb-btn { background: none; border: none; color: #fff; cursor: pointer; font-size: 14px; padding: 8px 12px; border-radius: 6px; }
.lightbox .lb-btn:hover { background: rgba(255,255,255,.15); }

/* ---------- Chat ---------- */
.chat-wrap { max-width: 820px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; height: calc(100vh - 160px); }
.chat-msgs { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 8px; }
.chat-msg { max-width: 70%; padding: 8px 12px; border-radius: 12px; background: #f1f3f4; font-size: 14px; }
.chat-msg.me { align-self: flex-end; background: #d3e3fd; }
.chat-msg .who { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.chat-input { display: flex; gap: 8px; padding-top: 12px; }
.chat-input input { flex: 1; }

/* ---------- Generic popover menu ---------- */
.gpop { position: absolute; background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 180px; z-index: 90; display: none; }
.gpop.open { display: block; }
.gpop .item { padding: 8px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.gpop .item:hover { background: var(--hover); }


/* ---------- Menu dropdowns ---------- */
.gmenubar .menu { cursor: pointer; }
.gmenu-drop { position: fixed; background: #fff; border-radius: 6px; box-shadow: var(--shadow-lg); padding: 6px 0; min-width: 220px; z-index: 120; }
.gmenu-drop .item { display: flex; justify-content: space-between; gap: 24px; padding: 7px 18px; font-size: 13px; cursor: pointer; color: var(--text); }
.gmenu-drop .item:hover { background: var(--hover); }
.gmenu-drop .item .sc { color: var(--muted); font-size: 12px; }
.gmenu-drop .sep { height: 1px; background: var(--border); margin: 5px 0; }

/* ---------- Sheet selection / resize ---------- */
.sheet-grid th[data-col], .sheet-grid th.rowhead, .sheet-grid th.addcol { cursor: pointer; user-select: none; }
.sheet-grid th.selected { background: #d3e3fd; color: #0b57d0; }
.sheet-grid th .rz { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }
.sheet-grid th { position: sticky; }


.sheet-grid.no-grid td, .sheet-grid.no-grid th { border-color: transparent; }


/* ---------- Support ---------- */
.osvc-page .card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.osvc-page .card h3 { margin: 0 0 6px; font-weight: 500; }
.osvc-page .card p { margin: 0; color: #5f6368; font-size: 13.5px; }
.cll-ticket label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.cll-ticket input, .cll-ticket textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; }
.os-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--blue-2); color: var(--accent); }


/* Clickable app logo */
a.gapp-icon, a.gmail-logo { text-decoration: none; color: inherit; }
a.gapp-icon:hover, a.gmail-logo:hover { text-decoration: none; }

/* ---------- Dark theme ---------- */
[data-theme="dark"] { --text: #e8eaed; --muted: #9aa0a6; --border: #3c4043; --surface: #292a2d; --surface-2: #202124; --hover: #303134; --blue: #8ab4f8; --accent: #8ab4f8; --blue-2: #1f3350; }
[data-theme="dark"] body { background: #202124; color: #e8eaed; }
[data-theme="dark"] .gapp,
[data-theme="dark"] .gbar,
[data-theme="dark"] .gmail-top,
[data-theme="dark"] .gmenubar,
[data-theme="dark"] .gtoolbar,
[data-theme="dark"] .sheets-formula,
[data-theme="dark"] .gmail-main,
[data-theme="dark"] .gmail-side,
[data-theme="dark"] .slides-rail,
[data-theme="dark"] .slides-side,
[data-theme="dark"] .docs-outline,
[data-theme="dark"] .gwaffle-menu,
[data-theme="dark"] .gmenu-drop,
[data-theme="dark"] .cll-ticket.card { background: #292a2d; color: #e8eaed; border-color: #3c4043; }
[data-theme="dark"] .gapp-static,
[data-theme="dark"] .gtitle,
[data-theme="dark"] .gbar-name,
[data-theme="dark"] .gbar-name b { color: #e8eaed; }
[data-theme="dark"] .docs-canvas,
[data-theme="dark"] body.docs,
[data-theme="dark"] body.sheets,
[data-theme="dark"] body.slides,
[data-theme="dark"] body.photos,
[data-theme="dark"] .slides-center { background: #202124; }
[data-theme="dark"] .docs-page { background: #292a2d; color: #e8eaed; }
[data-theme="dark"] .docs-page h1,
[data-theme="dark"] .docs-page h2,
[data-theme="dark"] .docs-page h3,
[data-theme="dark"] .docs-page p,
[data-theme="dark"] .docs-page li { color: #e8eaed; }
[data-theme="dark"] .gtoolbar button,
[data-theme="dark"] .gtoolbar .tbtn,
[data-theme="dark"] .gtoolbar select,
[data-theme="dark"] .icon-btn { color: #bdc1c6; }
[data-theme="dark"] .sheet-grid th { background: #292a2d; color: #9aa0a6; }
[data-theme="dark"] .sheet-grid th,
[data-theme="dark"] .sheet-grid td { border-color: #3c4043; color: #e8eaed; }
[data-theme="dark"] .sheet-grid th.selected,
[data-theme="dark"] .sheet-grid .active-col { background: #1f3350; color: #8ab4f8; }
[data-theme="dark"] .sheet-grid td:focus { background: #292a2d; }
[data-theme="dark"] .sheets-formula { background: #292a2d; border-color: #3c4043; }
[data-theme="dark"] .sheets-formula input { background: #202124; color: #e8eaed; border-color: #3c4043; }
[data-theme="dark"] .sheets-cellref, [data-theme="dark"] .sheets-fx { color: #9aa0a6; }
[data-theme="dark"] .sheets-tabs { background: #292a2d; border-color: #3c4043; }
[data-theme="dark"] .doc-card,
[data-theme="dark"] .cll-card,
[data-theme="dark"] .osvc-page .card { background: #292a2d !important; border-color: #3c4043 !important; color: #e8eaed; }
[data-theme="dark"] .doc-card .meta,
[data-theme="dark"] .doc-card .meta h3 { color: #e8eaed; }
[data-theme="dark"] .gmenu-drop .item,
[data-theme="dark"] .gwaffle-menu a,
[data-theme="dark"] .gwaffle-account { color: #e8eaed; }
[data-theme="dark"] .gmenu-drop .item:hover,
[data-theme="dark"] .gwaffle-menu a:hover { background: #303134; }
[data-theme="dark"] .gmail-row { border-color: #3c4043; }
[data-theme="dark"] .gmail-row .snip,
[data-theme="dark"] .gmail-row .date { color: #9aa0a6; }
[data-theme="dark"] input[type=text],
[data-theme="dark"] input[type=number],
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .gfield input,
[data-theme="dark"] .cll-ticket input,
[data-theme="dark"] .cll-ticket textarea { background: #292a2d; color: #e8eaed; border-color: #3c4043; }
[data-theme="dark"] .room-pill { background: #292a2d; border-color: #3c4043; color: #e8eaed; }
[data-theme="dark"] .chat-msg { background: #303134; color: #e8eaed; }
[data-theme="dark"] .chat-msg.me { background: #1f3350; }
[data-theme="dark"] .glogin-body { background: #202124; }
[data-theme="dark"] .glogin-card { background: #292a2d; border-color: #3c4043; color: #e8eaed; }

/* Dark fixes: elements that had hardcoded white backgrounds + var(--text) text */
[data-theme="dark"] .gbtn { background: #292a2d; color: #e8eaed; border-color: #3c4043; }
[data-theme="dark"] .gbtn:hover { background: #303134; }
[data-theme="dark"] .gbtn.primary { background: #14508c; color: #fff; border-color: #14508c; }
[data-theme="dark"] .gbtn.primary:hover { background: #0d3c6b; }
[data-theme="dark"] .gchip { background: #292a2d; color: #bdc1c6; border-color: #3c4043; }
[data-theme="dark"] .docs-toolbar { background: #292a2d; color: #bdc1c6; }
[data-theme="dark"] .docs-toolbar button { color: #bdc1c6; }
[data-theme="dark"] .docs-toolbar button:hover { background: #3c4043; }
[data-theme="dark"] .gmail-compose { background: #1f3350; color: #8ab4f8; }
[data-theme="dark"] .gmail-compose-box { background: #292a2d; color: #e8eaed; }
[data-theme="dark"] .gmail-compose-box .hd { background: #202124; color: #bdc1c6; }
[data-theme="dark"] .mail-detail { background: #292a2d; }
[data-theme="dark"] .gmail-search { background: #303134; color: #9aa0a6; }
[data-theme="dark"] .gmail-search input { background: transparent; color: #e8eaed; }
[data-theme="dark"] .gmail-toolbar { color: #9aa0a6; }
[data-theme="dark"] .doc-list h2 { color: #e8eaed; }
[data-theme="dark"] .empty { color: #9aa0a6; }
[data-theme="dark"] .sheet-grid { background: #202124; }
[data-theme="dark"] .slides-notes textarea { color: #bdc1c6; }
[data-theme="dark"] .sheet-grid td:focus { color: #e8eaed; }
[data-theme="dark"] .docs-findbar { background: #292a2d; border-color: #3c4043; }
[data-theme="dark"] .docs-findbar input { background: #202124; color: #e8eaed; border-color: #3c4043; }
[data-theme="dark"] .gpop { background: #292a2d; }
[data-theme="dark"] .gpop .item { color: #e8eaed; }
[data-theme="dark"] .os-toast { background: #3c4043; }

/* ---------- Share modal ---------- */
.os-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.os-modal { background: var(--surface); color: var(--text); width: 480px; max-width: 100%; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.4); padding: 22px; border: 1px solid var(--border); }
.os-modal-title { font-size: 19px; font-weight: 500; margin-bottom: 14px; word-break: break-word; }
.os-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.os-tab { background: none; border: none; padding: 9px 12px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.os-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.os-pane label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 12px 0 5px; }
.os-pane input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text); }
.os-pane input:focus { outline: none; border-color: var(--accent); }
.os-modal .hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.os-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.os-link-box { display: flex; gap: 8px; margin-top: 12px; }
.os-link-box input { flex: 1; }
.os-modal .gbtn { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.os-modal .gbtn:hover { background: var(--hover); }
.os-modal .gbtn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Notification bell ---------- */
.bell-wrap { position: relative; }
.bell-btn { position: relative; }
.bell-btn .badge { position: absolute; top: 2px; right: 2px; background: #d93025; color: #fff; font-size: 10px; border-radius: 999px; padding: 0 4px; min-width: 15px; text-align: center; }
.bell-menu { position: absolute; top: 48px; right: 0; width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); padding: 8px; z-index: 90; display: none; }
.bell-menu.open { display: block; }
.bell-menu .os-notif { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.bell-menu .os-notif:hover { background: var(--hover); }
.bell-menu .os-notif a { color: var(--accent); }

/* ---------- Slides canvas elements ---------- */
.se { position: absolute; cursor: move; }
.se:hover { outline: 2px solid #1a73e8; }
.se-text { width: 100%; height: 100%; color: #fff; font-size: 24px; font-weight: 600; outline: none; }
.se-text:focus { cursor: text; }
.se-rz { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: #1a73e8; border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; z-index: 2; }
.se img, .se video { pointer-events: none; }

/* ---------- Real-time presence ---------- */
.os-presence { display: inline-flex; align-items: center; margin-right: 6px; }
.os-av { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; margin-left: -6px; border: 2px solid var(--surface); }
.os-typing { font-size: 12px; color: var(--muted); margin-right: 8px; white-space: nowrap; }

/* ---------- Suggestion mode (Docs) ---------- */
.sug-add { color: #188038 !important; }
.sug-del { color: #d93025 !important; text-decoration: line-through; }
.sug-banner { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--border); font-size: 13px; }
.sug-banner .gspacer { flex: 1; }

/* ---------- Meet (Google-Meet-style room) ---------- */
body.meet-room { background: #202124; color: #e8eaed; }
.meet-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: #e8eaed; font-size: 14px; }
.meet-stage { display: flex; align-items: center; justify-content: center; height: calc(100vh - 64px - 90px); padding: 12px; }
.meet-tile { position: relative; width: min(1200px, 92vw); aspect-ratio: 16/9; background: #3c4043; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.meet-tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.meet-tile .off { color: #9aa0a6; font-size: 40px; }
.meet-name { position: absolute; left: 16px; bottom: 14px; background: rgba(0,0,0,.55); color: #fff; padding: 5px 10px; border-radius: 6px; font-size: 13px; }
.meet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; width: min(1200px, 92vw); }
.meet-controls { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; background: #3c4043; padding: 10px 14px; border-radius: 999px; }
.meet-btn { width: 48px; height: 48px; border-radius: 50%; border: none; background: #4a4d51; color: #fff; cursor: pointer; font-size: 18px; }
.meet-btn:hover { background: #5f6368; }
.meet-btn.off { background: #ea4335; }
.meet-btn.hang { background: #ea4335; width: auto; padding: 0 22px; border-radius: 999px; }

/* ---------- Dark fixes (slides side panel / cards) ---------- */
[data-theme="dark"] .slides-side .card { background: #202124; border-color: #3c4043; color: #e8eaed; }
[data-theme="dark"] .slides-side .card strong,
[data-theme="dark"] .slides-side .card b { color: #e8eaed; }
[data-theme="dark"] .slides-side h4 { color: #9aa0a6; }
[data-theme="dark"] .doc-card .top { background: #292a2d !important; }
[data-theme="dark"] .slides-notes { border-color: #3c4043; }
[data-theme="dark"] .mail-detail { color: #e8eaed; }
[data-theme="dark"] .sheet-grid td, [data-theme="dark"] .sheet-grid th { background: #202124; }
[data-theme="dark"] .sheet-grid th.active-col, [data-theme="dark"] .sheet-grid th.selected { background: #1f3350; }

/* ---------- Slides links in text boxes ---------- */
.se-link { color: #1a73e8 !important; text-decoration: underline; }
.se-linkchip { position: absolute; left: 0; top: 100%; margin-top: 3px; display: none; align-items: center; gap: 7px; background: #fff; border: 1px solid #dadce0; border-radius: 16px; padding: 3px 12px 3px 4px; font-size: 12px; color: #1a73e8; text-decoration: none; box-shadow: var(--shadow); white-space: nowrap; z-index: 5; }
.se.sel .se-linkchip { display: inline-flex; }
.se-linkchip:hover { text-decoration: none; background: #f1f3f4; }
.se-linkfav { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #1a73e8; color: #fff; font-size: 11px; font-weight: 700; }

/* ---------- Guide modal ---------- */
.os-modal-body h3 { font-size: 15px; margin: 16px 0 4px; color: var(--text); }
.os-modal-body h3:first-child { margin-top: 0; }
.os-modal-body p { color: var(--text-2); margin: 4px 0; font-size: 14px; }
.os-modal-body b { color: var(--text); }
[data-theme="dark"] .os-modal-body h3, [data-theme="dark"] .os-modal-body b { color: #e8eaed; }
[data-theme="dark"] .os-modal-body p { color: #bdc1c6; }

/* ---------- Mail nav icon sizing (fixes giant icons) ---------- */
.gmail-nav a { font-size: 14px; }
.gmail-nav a svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.gmail-compose svg { width: 20px; height: 20px; fill: currentColor; }
.gmail-side .label { margin-top: 12px; }

/* ---------- Mail theme contrast (dark = light text, light = dark text) ---------- */
.gmail-nav a { color: #202124; }
.gmail-nav .label { color: #5f6368; }
.gmail-row .from { color: #202124; font-weight: 700; }
.gmail-row .subj { color: #202124; }
[data-theme="dark"] .gmail-nav a { color: #e8eaed; }
[data-theme="dark"] .gmail-nav a.active { background: #1f3350; color: #8ab4f8; }
[data-theme="dark"] .gmail-nav a:hover { background: #303134; }
[data-theme="dark"] .gmail-nav .label { color: #9aa0a6; }
[data-theme="dark"] .gmail-logo { color: #9aa0a6; }
[data-theme="dark"] .gmail-row .from,
[data-theme="dark"] .gmail-row .subj { color: #e8eaed; }
[data-theme="dark"] .gmail-row.unread { background: #202124; }
[data-theme="dark"] .gmail-main { background: #202124; }
[data-theme="dark"] .gmail-toolbar { background: #292a2d; border-color: #3c4043; }
[data-theme="dark"] body.mail,
[data-theme="dark"] .gmail-app,
[data-theme="dark"] .gmail-side { background: #202124; }
[data-theme="dark"] .gmail-row { border-color: #3c4043; }

/* ---------- Slides (Google-style) ---------- */
.slides-rail .slide-thumb { position: relative; overflow: hidden; }
.slides-rail .slide-thumb .num { position: absolute; left: 4px; top: 2px; font-size: 10px; color: #9aa0a6; z-index: 2; }
.slides-panel { width: 240px; background: var(--surface); border-left: 1px solid var(--border); overflow: auto; padding: 12px; }
.slides-panel h4 { font-size: 13px; color: var(--muted); margin: 0 0 12px; font-weight: 500; }
.theme-swatch { height: 80px; border-radius: 6px; border: 1px solid var(--border); margin-bottom: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; overflow: hidden; }
.theme-swatch:hover { border-color: var(--blue); }
.se-shape { width: 100%; height: 100%; }
.se-shape.tri { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.se-shape.arrow { clip-path: polygon(0 35%, 55% 35%, 55% 0, 100% 50%, 55% 100%, 55% 65%, 0 65%); }
.se-shape.ellipse { border-radius: 50%; }
.se-shape.rounded { border-radius: 14px; }
.slide-placeholder { color: #9aa0a6; font-size: 30px; text-align: center; }

