/* Google Workspace Local Suite — Material 3 Unified Stylesheet */
:root {
  --gw-surface: #f8fafd;
  --gw-surface-card: #ffffff;
  --gw-surface-subtle: #edf2fc;
  --gw-search-bg: #eaf1fb;
  --gw-primary: #0b57d0;
  --gw-primary-hover: #0842a0;
  --gw-primary-container: #c2e7ff;
  --gw-on-primary-container: #001d35;
  --gw-selected-pill: #d3e3fd;
  --gw-text: #1f1f1f;
  --gw-text-muted: #444746;
  --gw-text-subtle: #5f6368;
  --gw-border: #e0e3e7;
  --gw-border-strong: #c4c7c5;
  --gw-green: #137333;
  --gw-green-bg: #e6f4ea;
  --gw-amber: #b06000;
  --gw-amber-bg: #fef7e0;
  --gw-red: #c5221f;
  --gw-red-bg: #fce8e6;
  --gw-shadow-sm: 0 1px 2px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --gw-shadow-md: 0 4px 12px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
  --gw-shadow-lg: 0 8px 28px rgba(0,0,0,0.18);
  --gw-font: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --gw-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--gw-font);
  font-size: 14px;
  color: var(--gw-text);
  background: var(--gw-surface);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* Shell Layout */
.gw-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--gw-surface);
}

/* Top Bar */
.gw-topbar {
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 12px;
  background: var(--gw-surface);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 40;
}

.gw-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 215px;
}

.gw-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gw-text-muted);
  transition: background 0.15s ease;
}

.gw-icon-btn:hover {
  background: rgba(31, 31, 31, 0.08);
}

.gw-icon-btn-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gw-text-muted);
}

.gw-icon-btn-sm:hover {
  background: rgba(0,0,0,0.08);
}

.gw-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  border-radius: 10px;
}

.gw-brand:hover {
  background: rgba(0,0,0,0.04);
}

.gw-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.gw-brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gw-brand-title {
  font-size: 19px;
  font-weight: 500;
  color: #444746;
  letter-spacing: -0.2px;
}

.gw-brand-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #e8f0fe;
  color: var(--gw-primary);
}

/* Search Box */
.gw-search-wrap {
  flex: 1;
  max-width: 680px;
  position: relative;
}

.gw-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  background: var(--gw-search-bg);
  border-radius: 24px;
  border: 1px solid transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.gw-search-box:focus-within {
  background: #ffffff;
  border-color: #d2e3fc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.gw-search-icon {
  color: var(--gw-text-muted);
  flex-shrink: 0;
}

.gw-search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--gw-text);
  min-width: 100px;
}

.gw-search-kbd {
  font-size: 11px;
  font-family: var(--gw-mono);
  color: var(--gw-text-subtle);
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--gw-border);
  padding: 2px 6px;
  border-radius: 6px;
}

.gw-search-dropdown {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--gw-shadow-lg);
  border: 1px solid var(--gw-border);
  max-height: 420px;
  overflow-y: auto;
  z-index: 100;
  padding: 8px;
}

.gw-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.gw-search-item:hover {
  background: #f1f5fb;
}

.gw-search-item-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--gw-text);
}

.gw-search-item-sub {
  font-size: 12px;
  color: var(--gw-text-subtle);
  margin-top: 2px;
}

.gw-search-app-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 12px;
  background: #e8f0fe;
  color: var(--gw-primary);
  flex-shrink: 0;
}

/* Top Bar Right */
.gw-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gw-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--gw-border);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gw-text-muted);
}

.gw-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #188038;
}

.gw-top-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--gw-primary-container);
  color: var(--gw-on-primary-container);
  font-weight: 600;
  font-size: 13px;
  transition: box-shadow 0.15s ease;
}

.gw-top-action-btn:hover {
  box-shadow: var(--gw-shadow-sm);
}

.gw-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--gw-border);
  background: #ffffff;
}

.gw-user-org {
  font-size: 12px;
  font-weight: 600;
  color: #444746;
}

.gw-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 9-Dot Waffle App Switcher */
.gw-waffle-menu {
  position: fixed;
  top: 64px;
  right: 18px;
  width: 330px;
  background: #f8fafd;
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--gw-shadow-lg);
  border: 1px solid var(--gw-border);
  z-index: 120;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gw-waffle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.gw-waffle-item:hover, .gw-waffle-item.active {
  background: #e8f0fe;
}

.gw-waffle-item span {
  font-size: 12px;
  font-weight: 500;
  color: var(--gw-text);
}

/* Main Body */
.gw-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Left App Rail */
.gw-app-rail {
  width: 68px;
  min-width: 68px;
  background: var(--gw-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  gap: 4px;
  overflow-y: auto;
  z-index: 20;
}

.gw-rail-btn {
  width: 58px;
  padding: 7px 2px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--gw-text-muted);
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.gw-rail-btn:hover {
  background: rgba(11, 87, 208, 0.08);
}

.gw-rail-btn.active {
  background: var(--gw-selected-pill);
  color: var(--gw-on-primary-container);
  font-weight: 600;
}

.gw-rail-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gw-rail-label {
  font-size: 10.5px;
  line-height: 1.1;
  text-align: center;
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-rail-badge {
  position: absolute;
  top: 3px;
  right: 6px;
  background: #c5221f;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
}

/* Main Active App Viewport */
.gw-main-workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 0 8px 8px 0;
  background: var(--gw-surface-card);
  border-radius: 16px;
  border: 1px solid var(--gw-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* Right Companion Panel */
.gw-companion {
  width: 268px;
  min-width: 268px;
  background: var(--gw-surface);
  border-left: 1px solid var(--gw-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.gw-companion.collapsed {
  width: 0;
  min-width: 0;
  border-left: none;
}

.gw-companion-tabs {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 44px;
  border-bottom: 1px solid var(--gw-border);
  background: #ffffff;
}

.gw-comp-btn {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid transparent;
}

.gw-comp-btn.active {
  border-bottom-color: var(--gw-primary);
  background: #f8fafd;
}

.gw-companion-drawer {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #ffffff;
}

/* Common App Sub-Shell (Left Sidebar + Content) */
.app-split-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.app-sidebar {
  width: 236px;
  min-width: 236px;
  background: #f8fafd;
  border-right: 1px solid var(--gw-border);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

.gw-fab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border-radius: 16px;
  background: var(--gw-primary-container);
  color: var(--gw-on-primary-container);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  width: fit-content;
}

.gw-fab-btn:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.16);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13.5px;
  color: var(--gw-text-muted);
  cursor: pointer;
  user-select: none;
}

.sidebar-nav-item:hover {
  background: rgba(0,0,0,0.05);
}

.sidebar-nav-item.active {
  background: var(--gw-selected-pill);
  color: var(--gw-on-primary-container);
  font-weight: 600;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gw-text-subtle);
  padding: 12px 12px 4px;
}

/* Buttons & Badges */
.gw-btn-primary {
  background: var(--gw-primary);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 18px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gw-btn-primary:hover {
  background: var(--gw-primary-hover);
}

.gw-btn-secondary {
  background: #f1f3f4;
  color: var(--gw-text);
  padding: 7px 14px;
  border-radius: 18px;
  font-weight: 500;
  font-size: 13px;
  border: 1px solid var(--gw-border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gw-btn-secondary:hover {
  background: #e4e7eb;
}

.gw-pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #e8f0fe;
  color: var(--gw-primary);
}

/* Gmail Styles */
.mail-toolbar {
  height: 46px;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--gw-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mail-category-tabs {
  display: flex;
  border-bottom: 1px solid var(--gw-border);
  padding: 0 12px;
  background: #ffffff;
}

.mail-cat-tab {
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gw-text-subtle);
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mail-cat-tab.active {
  color: var(--gw-primary);
  border-bottom-color: var(--gw-primary);
  font-weight: 600;
}

.mail-list {
  flex: 1;
  overflow-y: auto;
}

.mail-row {
  display: grid;
  grid-template-columns: 32px 28px 180px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  font-size: 13.5px;
}

.mail-row:hover {
  box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(60,64,67,0.15);
  background: #f8fafd;
}

.mail-row.unread {
  background: #f2f6fc;
  font-weight: 600;
}

.mail-sender {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-subject-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mail-snippet {
  font-weight: 400;
  color: var(--gw-text-subtle);
}

.mail-thread-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}

.mail-msg-card {
  border: 1px solid var(--gw-border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 14px;
  background: #ffffff;
}

.mail-msg-body {
  margin-top: 12px;
  line-height: 1.6;
  color: #202124;
}

.mail-msg-body ul, .mail-msg-body ol {
  padding-left: 22px;
  margin: 8px 0;
}

/* Floating Compose Modal */
.gw-compose-modal {
  position: fixed;
  bottom: 0;
  right: 68px;
  width: 500px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border-radius: 14px 14px 0 0;
  box-shadow: var(--gw-shadow-lg);
  border: 1px solid var(--gw-border);
  z-index: 110;
  display: flex;
  flex-direction: column;
}

.gw-compose-header {
  background: #f2f6fc;
  padding: 10px 16px;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13.5px;
}

.gw-compose-body {
  display: flex;
  flex-direction: column;
  padding: 8px 16px;
}

.gw-compose-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f1f3f4;
  padding: 6px 0;
}

.gw-compose-row label {
  width: 52px;
  font-size: 12.5px;
  color: var(--gw-text-subtle);
}

.gw-compose-row input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13.5px;
}

#gw-compose-text {
  height: 190px;
  border: none;
  outline: none;
  resize: none;
  padding: 10px 0;
  line-height: 1.5;
}

.gw-compose-footer {
  padding: 10px 16px;
  border-top: 1px solid #f1f3f4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gw-compose-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--gw-text-subtle);
}

/* Calendar Grid Styles */
.cal-week-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  overflow-y: auto;
  border-top: 1px solid var(--gw-border);
}

.cal-day-header {
  padding: 10px 6px;
  text-align: center;
  border-bottom: 1px solid var(--gw-border);
  border-left: 1px solid #f1f3f4;
  background: #f8fafd;
  position: sticky;
  top: 0;
  z-index: 5;
}

.cal-day-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-top: 2px;
}

.cal-day-num.today {
  background: var(--gw-primary);
  color: #ffffff;
}

.cal-event-chip {
  padding: 5px 8px;
  border-radius: 6px;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  margin: 4px 4px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  overflow: hidden;
}

/* Chat Styles */
.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 6px 8px;
  border-radius: 10px;
}

.chat-bubble-row:hover {
  background: #f8fafd;
}

.chat-composer {
  padding: 12px 18px;
  border-top: 1px solid var(--gw-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
}

.chat-composer input {
  flex: 1;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--gw-border-strong);
  padding: 0 16px;
  outline: none;
}

/* Drive Cards & Table */
.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px;
}

.drive-card {
  border: 1px solid var(--gw-border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.drive-card:hover, .drive-card.selected {
  border-color: var(--gw-primary);
  box-shadow: var(--gw-shadow-sm);
  background: #f8fafd;
}

/* Google Docs Paginated Canvas */
.docs-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 14px;
  margin: 6px 14px;
  background: #edf2fa;
  border-radius: 24px;
}

.docs-tool-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #444746;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.docs-tool-btn:hover {
  background: rgba(0,0,0,0.08);
}

.docs-canvas-wrap {
  flex: 1;
  overflow-y: auto;
  background: #f8fafd;
  padding: 24px 16px 48px;
  display: flex;
  justify-content: center;
}

.docs-page {
  width: 816px;
  max-width: 100%;
  min-height: 980px;
  background: #ffffff;
  border: 1px solid #dadce0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 64px 72px;
  outline: none;
  line-height: 1.65;
  font-size: 14.5px;
}

.docs-page h1 { font-size: 24px; margin-bottom: 10px; color: #1f1f1f; }
.docs-page h2 { font-size: 17px; margin: 18px 0 8px; color: #0b57d0; }
.docs-page p { margin-bottom: 10px; }
.docs-page ul, .docs-page ol { padding-left: 24px; margin-bottom: 12px; }
.docs-page hr { border: none; border-top: 1px solid #e0e3e7; margin: 14px 0; }
.docs-page table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
.docs-page th, .docs-page td { border: 1px solid #dadce0; padding: 8px 10px; text-align: left; }
.docs-page th { background: #e8f0fe; color: #0b57d0; }

/* Google Sheets Grid */
.sheets-formula-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--gw-border);
  background: #ffffff;
}

.sheets-cell-ref {
  width: 64px;
  text-align: center;
  font-weight: 700;
  font-family: var(--gw-mono);
  background: #f1f3f4;
  border-radius: 6px;
  padding: 4px 0;
  font-size: 12.5px;
}

.sheets-grid-wrap {
  flex: 1;
  overflow: auto;
  background: #ffffff;
}

.sheets-table {
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12.5px;
}

.sheets-table th {
  background: #f8fafd;
  border: 1px solid #dadce0;
  color: #444746;
  font-weight: 600;
  height: 26px;
  min-width: 110px;
  user-select: none;
}

.sheets-table th.row-hdr {
  min-width: 42px;
  width: 42px;
  text-align: center;
}

.sheets-table td {
  border: 1px solid #e0e3e7;
  height: 28px;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: cell;
}

.sheets-table td.active-cell {
  outline: 2px solid #0b57d0;
  outline-offset: -2px;
  background: #f8fbff;
}

/* Google Slides Canvas */
.slides-stage-wrap {
  flex: 1;
  background: #e9eef6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}

.slides-canvas-16x9 {
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Universal Modal & Toast */
.gw-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.gw-modal-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--gw-shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.gw-toast-container {
  position: fixed;
  bottom: 20px;
  left: 84px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
}

.gw-toast {
  background: #323232;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--gw-shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Contact Autocomplete Dropdown & Chips */
.gw-autocomplete-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--gw-border);
  border-radius: 12px;
  box-shadow: var(--gw-shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 400;
  min-width: 280px;
  padding: 6px;
}

.gw-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
}

.gw-autocomplete-item:hover,
.gw-autocomplete-item.active {
  background: #e8f0fe;
}

.gw-compose-modal.maximized {
  width: min(860px, calc(100vw - 40px));
  right: 20px;
}

.gw-compose-modal.minimized .gw-compose-body,
.gw-compose-modal.minimized .gw-compose-footer {
  display: none;
}

/* Calendar Drag & Resize */
.cal-event-chip {
  user-select: none;
  transition: box-shadow 0.12s ease, opacity 0.12s ease;
}

.cal-event-chip:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.24);
  z-index: 10 !important;
}

.cal-event-chip.dragging {
  opacity: 0.45;
}

.cal-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  cursor: ns-resize;
  background: rgba(255,255,255,0.22);
  border-radius: 0 0 6px 6px;
}

.cal-resize-handle:hover {
  background: rgba(255,255,255,0.55);
}

.cal-drag-ghost {
  position: absolute;
  left: 3px;
  right: 3px;
  background: rgba(11, 87, 208, 0.22);
  border: 2px dashed #0b57d0;
  border-radius: 6px;
  pointer-events: none;
  z-index: 9;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #0b57d0;
}

/* Drive Context Menu & Drag-and-Drop */
.gw-context-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--gw-border);
  border-radius: 12px;
  box-shadow: var(--gw-shadow-lg);
  min-width: 220px;
  padding: 6px;
  z-index: 350;
}

.gw-context-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--gw-text);
  text-align: left;
}

.gw-context-item:hover {
  background: #e8f0fe;
  color: var(--gw-primary);
}

.gw-context-divider {
  height: 1px;
  background: var(--gw-border);
  margin: 5px 4px;
}

.drive-drop-target {
  outline: 2px dashed #0b57d0 !important;
  background: #e8f0fe !important;
}

/* Responsive Breakpoints (Tablet 768px & Mobile 375px) */
@media (max-width: 1024px) {
  .gw-companion {
    display: none;
  }
  .app-sidebar {
    width: 190px;
    min-width: 190px;
  }
  .docs-page {
    padding: 36px 32px;
  }
}

@media (max-width: 760px) {
  .gw-topbar-left {
    min-width: auto;
  }
  .gw-brand-badge, .gw-user-org, .gw-status-pill, .gw-search-kbd, .gw-quick-compose-btn span, #gw-reset-mock-btn {
    display: none;
  }
  .gw-quick-compose-btn {
    padding: 0 8px;
  }
  .drive-inspector {
    display: none;
  }
  .gw-app-rail {
    width: 52px;
    min-width: 52px;
  }
  .gw-rail-btn {
    width: 46px;
  }
  .gw-rail-label {
    font-size: 9px;
  }
  .app-sidebar {
    display: none;
  }
  .mail-row {
    grid-template-columns: 24px 110px 1fr auto;
  }
  .mail-row .mail-star-col {
    display: none;
  }
  .gw-compose-modal {
    right: 8px;
    left: 8px;
    width: auto;
  }
}

/* Live In-Canvas Collaborator Carets & Presence */
.docs-page-stage {
  position: relative;
  width: 100%;
  max-width: 816px;
  margin: 0 auto;
}
.docs-remote-carets-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}
.docs-remote-caret {
  position: absolute;
  width: 2px;
  height: 20px;
  pointer-events: none;
  transition: top 120ms ease-out, left 120ms ease-out;
}
.docs-remote-caret-flag {
  position: absolute;
  top: -19px;
  left: -2px;
  padding: 2px 7px;
  border-radius: 6px 6px 6px 0;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.docs-collab-count-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 15px;
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #ceead6;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.docs-net-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  cursor: pointer;
}
.docs-net-btn.flaky {
  background: #fef7e0;
  color: #b06000;
  border-color: #fde293;
}
.docs-net-btn.offline {
  background: #fce8e6;
  color: #c5221f;
  border-color: #fad2cf;
}

@media print {
  .gw-topbar,
  .gw-app-rail,
  .gw-companion,
  .gw-compose-modal,
  .docs-header-bar,
  .docs-toolbar,
  .docs-outline,
  .docs-comments,
  .sheets-header,
  .sheets-toolbar,
  .sheets-formula-bar,
  .sheets-tabs {
    display: none !important;
  }
  body,
  .gw-shell,
  .gw-body,
  .gw-main-workspace,
  .docs-canvas-scroll {
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .docs-page {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    width: 100% !important;
  }
}
