/* ==========================================================================
   Tmail — 1:1 Gmail / Jmail-inspired Public Record Inbox
   Pure static CSS, Material 3 surface tokens, zero trackers.
   ========================================================================== */

:root {
  --shell-bg: #f6f8fc;
  --surface: #ffffff;
  --surface-tint: #f8fafd;
  --search-bg: #eaf1fb;
  --search-focus: #ffffff;
  --compose-bg: #c2e7ff;
  --compose-text: #001d35;
  --nav-active-bg: #d3e3fd;
  --nav-active-text: #001d35;
  --nav-hover: #e8edf5;
  --row-read-bg: #f2f6fc;
  --row-unread-bg: #ffffff;
  --border: #e1e3e1;
  --border-subtle: #eceff1;
  --text-primary: #1f1f1f;
  --text-secondary: #444746;
  --text-muted: #5f6368;
  --accent-blue: #0b57d0;
  --accent-blue-soft: #d2e3fc;
  --verified-bg: #c4eed0;
  --verified-text: #0f5132;
  --badge-red-bg: #d93025;
  --badge-green-bg: #188038;
  --chip-bg: #eceff1;
  --star-gold: #f4b400;
  --sidebar-w: 256px;
  --topbar-h: 64px;
  --radius-card: 16px;
  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--shell-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}

.material-symbols-outlined.is-filled {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
}

/* ---------- APP SHELL ---------- */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--shell-bg);
}

/* ---------- TOPBAR ---------- */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 8px 12px;
  background: var(--shell-bg);
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  width: calc(var(--sidebar-w) - 16px);
  flex-shrink: 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  text-decoration: none !important;
}

.brand-mark {
  width: 32px;
  height: 24px;
  flex-shrink: 0;
}

.brand-text {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #5f6368;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(60, 64, 67, 0.08);
}

.icon-btn-sm {
  width: 34px;
  height: 34px;
}

/* Search Pill */
.search-form {
  position: relative;
  flex: 1;
  max-width: 720px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 8px;
  background: var(--search-bg);
  border-radius: 24px;
  border: 1px solid transparent;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.search-form:focus-within {
  background: var(--search-focus);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.25), 0 2px 6px 2px rgba(60, 64, 67, 0.12);
}

.search-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-primary);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.search-chip {
  height: 28px;
  padding: 0 9px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.search-chip:hover {
  background: rgba(11, 87, 208, 0.08);
  color: var(--accent-blue);
}

.search-chip .material-symbols-outlined {
  font-size: 16px;
}

.kbd-hint {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(60, 64, 67, 0.08);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
}

.popover-menu {
  position: absolute;
  top: 52px;
  right: 8px;
  width: 260px;
  max-height: 340px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  padding: 6px;
  z-index: 60;
}

.popover-heading {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.popover-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

.popover-item:hover {
  background: var(--search-bg);
}

/* Topbar Right */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-pill-btn {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dadce0;
  border-radius: 18px;
  background: #ffffff;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.icon-pill-btn:hover {
  background: #f1f3f4;
}

.icon-pill-btn .material-symbols-outlined {
  font-size: 17px;
}

.jemini-pill {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #d2e3fc;
  border-radius: 20px;
  background: #ffffff;
  color: #1f1f1f;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  transition: box-shadow 140ms ease, background 140ms ease;
}

.jemini-pill:hover {
  background: #f8fbff;
  box-shadow: 0 2px 6px rgba(11, 87, 208, 0.16);
}

.sparkle-dot {
  background: linear-gradient(135deg, #4285f4, #ea4335, #fbbc04, #34a853);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 16px;
}

.apps-wrap, .profile-wrap {
  position: relative;
}

.apps-menu {
  position: absolute;
  top: 48px;
  right: 0;
  width: 280px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  z-index: 60;
}

.apps-menu-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 0 4px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.app-tile {
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none !important;
}

.app-tile:hover {
  background: var(--search-bg);
}

.app-tile-icon, .dock-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.tile-mail { background: linear-gradient(135deg, #ea4335, #c5221f); }
.tile-photos { background: linear-gradient(135deg, #4285f4, #fbbc04); }
.tile-drive { background: linear-gradient(135deg, #34a853, #188038); }
.tile-cal { background: linear-gradient(135deg, #1a73e8, #0b57d0); }
.tile-memes { background: linear-gradient(135deg, #f5b942, #d97706); }
.tile-report { background: linear-gradient(135deg, #d97757, #b45333); }

.lang-picker-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  font-size: 13px;
}
.lang-picker-pill .material-symbols-outlined { font-size: 17px; color: #5f6368; }
.tmail-lang-select {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  max-width: 164px;
}
.tile-gh { background: #24292f; }

.profile-avatar-btn {
  border: none;
  background: transparent;
  padding: 2px;
  cursor: pointer;
  border-radius: 50%;
}

.avatar-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(#ea4335 0deg 90deg, #4285f4 90deg 180deg, #34a853 180deg 270deg, #fbbc04 270deg 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #141413;
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-menu {
  position: absolute;
  top: 48px;
  right: 0;
  width: 310px;
  background: #e9eef6;
  border: 1px solid #d3dce8;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  text-align: center;
  z-index: 60;
}

.profile-email {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 14px;
  word-break: break-all;
}

.profile-big-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #141413;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px #ffffff;
}

.profile-greeting {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.profile-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.profile-btn {
  padding: 8px 12px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #c4c7c5;
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none !important;
}

.profile-btn:hover {
  background: #f0f4fa;
}

.profile-foot {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- WORKSPACE ---------- */
.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 0 16px 12px 0;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 12px 76px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  transition: width 160ms ease, opacity 160ms ease;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
}

.compose-wrap {
  padding: 4px 0 14px 8px;
}

.compose-btn {
  height: 54px;
  padding: 0 22px 0 16px;
  border: none;
  border-radius: 16px;
  background: var(--compose-bg);
  color: var(--compose-text);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: box-shadow 140ms ease, background 140ms ease;
}

.compose-btn:hover {
  background: #b5e0ff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.folder-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 12px;
}

.nav-row {
  height: 34px;
  padding: 0 14px 0 22px;
  border: none;
  border-radius: 0 20px 20px 0;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  font-weight: 400;
  transition: background 100ms ease;
}

.nav-row:hover {
  background: var(--nav-hover);
}

.nav-row.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  font-weight: 600;
}

.nav-row.active .nav-ico {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
  color: var(--accent-blue);
}

.nav-ico {
  font-size: 19px;
  color: var(--text-secondary);
}

.nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.nav-row.active .nav-count {
  font-weight: 700;
  color: var(--nav-active-text);
}

/* Sidebar Sections: TOPICS & PEOPLE */
.sidebar-section {
  border-top: 1px solid rgba(60, 64, 67, 0.08);
  padding-top: 8px;
  margin-top: 4px;
}

.section-toggle {
  width: 100%;
  padding: 6px 12px 6px 14px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.section-toggle:hover {
  color: var(--text-primary);
}

.section-title-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.toggle-caret {
  font-size: 18px;
  transition: transform 140ms ease;
}

.section-toggle[aria-expanded="false"] .toggle-caret {
  transform: rotate(-90deg);
}

.topic-list, .people-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.topic-btn, .person-btn {
  width: 100%;
  height: 32px;
  padding: 0 14px 0 22px;
  border: none;
  border-radius: 0 18px 18px 0;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.topic-btn:hover, .person-btn:hover {
  background: var(--nav-hover);
}

.topic-btn.active, .person-btn.active {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-weight: 600;
}

.topic-btn .material-symbols-outlined {
  font-size: 17px;
  color: var(--text-secondary);
}

.topic-btn.active .material-symbols-outlined {
  color: var(--accent-blue);
}

.browse-people-btn {
  width: 100%;
  padding: 6px 14px 8px 22px;
  border: none;
  background: transparent;
  color: var(--accent-blue);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.browse-people-btn:hover {
  text-decoration: underline;
}

.person-btn {
  padding-left: 22px;
  justify-content: space-between;
}

.person-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-count {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ---------- MAIN WHITE INBOX CARD ---------- */
.main-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  overflow: hidden;
  position: relative;
}

/* Overview Banner */
.overview-banner {
  margin: 12px 16px 4px;
  padding: 12px 16px;
  background: var(--surface-tint);
  border: 1px solid #e3e8f2;
  border-radius: 12px;
  flex-shrink: 0;
}

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.overview-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.overview-sparkle {
  color: #1a73e8;
  font-size: 16px;
}

.overview-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.span-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 11.5px;
  font-weight: 600;
}

.overview-body {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.overview-banner.is-collapsed .overview-body {
  display: none;
}

.overview-banner.is-collapsed #overviewToggleBtn .material-symbols-outlined {
  transform: rotate(180deg);
}

.inline-link-btn {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--accent-blue);
  font-weight: 500;
  cursor: pointer;
}

.inline-link-btn:hover {
  text-decoration: underline;
}

.inline-link {
  font-weight: 500;
}

/* View panes */
.view-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-pane[hidden] {
  display: none !important;
}

/* Toolbar */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.tool-btn {
  height: 32px;
  padding: 0 11px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
}

.tool-btn:hover {
  background: #f1f3f4;
  color: var(--text-primary);
}

.tool-btn .material-symbols-outlined {
  font-size: 17px;
}

.select-pill {
  position: relative;
  height: 32px;
  padding: 0 8px 0 9px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.select-pill:hover {
  background: #f8f9fa;
}

.select-pill .material-symbols-outlined {
  font-size: 16px;
}

.select-pill select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  padding-right: 4px;
}

.select-pill-highlight {
  border-color: #aecbfa;
  background: #f8fbff;
}

.pill-badge-new {
  position: absolute;
  top: -8px;
  right: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #d93025;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.range-label {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Active filter chips */
.active-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #f8fbff;
  border-bottom: 1px solid #e3ecfa;
  font-size: 12.5px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #d2e3fc;
  color: #174ea6;
  font-weight: 600;
  font-size: 12px;
}

.active-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 8px;
  flex-shrink: 0;
  overflow-x: auto;
}

.cat-tab {
  position: relative;
  min-width: 190px;
  max-width: 280px;
  flex: 1;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease;
}

.cat-tab:hover {
  background: #f5f7fa;
}

.cat-tab.active {
  color: var(--accent-blue);
}

.cat-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent-blue);
}

.cat-tab-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-tab-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-tab-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.cat-tab-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
}

.badge-red { background: var(--badge-red-bg); }
.badge-green { background: var(--badge-green-bg); }

/* Email Rows */
.email-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 84px;
}

.email-row {
  display: grid;
  grid-template-columns: 82px 215px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 16px 7px 14px;
  border-bottom: 1px solid #eceff1;
  background: var(--row-unread-bg);
  cursor: pointer;
  transition: box-shadow 100ms ease, background 100ms ease;
}

.email-row.is-read {
  background: var(--row-read-bg);
}

.email-row:hover {
  box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 3px 0 rgba(60, 64, 67, 0.25);
  z-index: 2;
  position: relative;
}

.row-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.star-btn {
  border: none;
  background: transparent;
  padding: 2px 4px;
  border-radius: 6px;
  color: #9aa0a6;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.star-btn:hover {
  background: rgba(60, 64, 67, 0.08);
  color: var(--text-primary);
}

.star-btn.is-starred {
  color: var(--star-gold);
}

.star-btn.is-starred .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}

.star-btn .material-symbols-outlined {
  font-size: 18px;
}

.row-sender {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.email-row.is-read .row-sender {
  font-weight: 400;
}

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

.msg-count {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.row-main {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.platform-chip {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--chip-bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.platform-chip.chip-deleted {
  background: #fce8e6;
  color: #b31412;
}

.platform-chip.chip-open {
  background: #fef7e0;
  color: #b06000;
}

.row-subject {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58%;
}

.email-row.is-read .row-subject {
  font-weight: 400;
}

.row-snippet {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.attach-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.attach-pill .material-symbols-outlined {
  font-size: 15px;
}

.row-date {
  min-width: 82px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.email-row.is-read .row-date {
  font-weight: 400;
  color: var(--text-muted);
}

.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .material-symbols-outlined {
  font-size: 40px;
  margin-bottom: 10px;
  color: #9aa0a6;
}

/* ---------- THREAD DETAIL VIEW ---------- */
.thread-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.thread-toolbar-left, .thread-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified-pill {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--verified-bg);
  color: var(--verified-text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
}

.verified-pill:hover {
  filter: brightness(0.96);
}

.verified-pill .material-symbols-outlined {
  font-size: 16px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}

.thread-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.thread-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 32px 96px 64px;
}

.thread-inner {
  max-width: 920px;
}

.thread-subject-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.thread-subject {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-primary);
}

.thread-msg-card {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msg-body-wrap {
  flex: 1;
  min-width: 0;
}

.msg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.msg-sender-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.msg-sender-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.msg-handle {
  font-size: 12px;
  color: var(--text-muted);
}

.msg-to {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.msg-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.msg-text {
  font-size: 14px;
  line-height: 1.65;
  color: #202124;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg-text code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: #f1f3f4;
  padding: 1px 5px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.msg-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.att-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafd;
  cursor: pointer;
  transition: box-shadow 140ms ease, transform 140ms ease;
  text-align: left;
  padding: 0;
}

.att-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.att-thumb {
  width: 100%;
  height: 112px;
  object-fit: cover;
  display: block;
  background: #eef1f6;
}

.att-meta {
  padding: 7px 9px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.source-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5fb;
  border: 1px solid #d2e3fc;
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none !important;
}

.source-link-pill:hover {
  background: #e3edfc;
}

.thread-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.gmail-reply-btn {
  height: 36px;
  padding: 0 18px;
  border: 1px solid #747775;
  border-radius: 18px;
  background: #ffffff;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none !important;
}

.gmail-reply-btn:hover {
  background: #f1f3f4;
  color: var(--text-primary);
}

.gmail-reply-btn .material-symbols-outlined {
  font-size: 18px;
}

/* ---------- SUB-APP PANES (TPhotos / TCal / TDrive / People) ---------- */
.subapp-pane {
  overflow-y: auto;
  padding: 18px 22px 96px;
}

.subapp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.subapp-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
}

.subapp-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 680px;
}

.subapp-search {
  width: 300px;
  max-width: 100%;
  height: 38px;
  padding: 0 14px;
  border-radius: 19px;
  border: 1px solid #dadce0;
  background: var(--search-bg);
  outline: none;
  font-size: 13px;
}

.subapp-search:focus {
  background: #ffffff;
  border-color: var(--accent-blue);
}

/* TPhotos Grid */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.photo-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  transition: box-shadow 140ms ease, transform 140ms ease;
}

.photo-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.photo-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #f1f3f4;
}

.photo-card-body {
  padding: 10px 12px;
}

.photo-card-part {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e8f0fe;
  color: #174ea6;
  margin-bottom: 5px;
}

.photo-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* TCal Activity */
.activity-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-tint);
  border: 1px solid #e3e8f2;
}

.metric-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.metric-num.is-danger {
  color: #c5221f;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.activity-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
}

.chart-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #fafbfd;
  display: block;
}

.chart-card-cap {
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.timeline-row:hover {
  background: #f8fbff;
  border-color: #c6dafc;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
}

/* TDrive & People Directory */
.drive-grid, .people-dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.drive-card, .person-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none !important;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

.drive-card:hover, .person-card:hover {
  border-color: #aecbfa;
  box-shadow: 0 3px 12px rgba(11, 87, 208, 0.1);
}

.person-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.person-card-name {
  font-size: 14px;
  font-weight: 600;
}

.person-card-role {
  font-size: 12px;
  color: var(--text-muted);
}

.person-card-span {
  font-size: 11.5px;
  color: var(--accent-blue);
  font-weight: 500;
}

/* ---------- FLOATING BOTTOM DOCK (JMAIL SIGNATURE) ---------- */
.floating-dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(60, 64, 67, 0.14);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  z-index: 45;
}

.dock-btn {
  position: relative;
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: var(--text-secondary);
  text-decoration: none !important;
  transition: transform 140ms ease, background 140ms ease;
}

.dock-btn:hover {
  transform: translateY(-3px);
  background: rgba(11, 87, 208, 0.06);
}

.dock-btn.active::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-primary);
  position: absolute;
  bottom: -1px;
}

.dock-label {
  font-size: 10.5px;
  font-weight: 600;
}

.dock-badge {
  position: absolute;
  top: 0;
  right: 2px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #ea4335;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
}

/* ---------- MODAL & LIGHTBOX ---------- */
.modal-overlay, .lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay[hidden], .lightbox[hidden] {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  padding: 20px 24px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-body pre {
  background: #f6f8fc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.lightbox-card {
  width: 100%;
  max-width: 1120px;
  max-height: 92vh;
  background: #ffffff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.lightbox-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  background: #111317;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 14px;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-caption {
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}

/* Toast */
.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #202124;
  color: #ffffff;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  z-index: 120;
}

.toast[hidden] {
  display: none !important;
}

/* ---------- RESPONSIVE MOBILE ---------- */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 40;
}

.sidebar-backdrop[hidden] {
  display: none !important;
}

[dir="rtl"] .apps-menu,
[dir="rtl"] .profile-menu {
  right: auto;
  left: 0;
}

@media (max-width: 960px) {
  .topbar-left {
    width: auto;
  }

  .search-chips {
    display: none;
  }

  .jemini-pill {
    display: none;
  }

  .lang-picker-pill {
    padding: 0 8px;
  }

  .tmail-lang-select {
    max-width: 124px;
  }

  .workspace {
    padding: 0 8px 8px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 276px;
    max-width: 84vw;
    background: var(--shell-bg);
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    padding-top: max(12px, env(safe-area-inset-top));
  }

  [dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  }

  .app-shell.mobile-sidebar-open .sidebar {
    transform: translateX(0);
    width: 276px;
    opacity: 1;
    padding: max(12px, env(safe-area-inset-top)) 12px 84px 0;
  }

  [dir="rtl"] .app-shell.mobile-sidebar-open .sidebar {
    padding: max(12px, env(safe-area-inset-top)) 0 84px 12px;
  }

  .sidebar-backdrop {
    z-index: 65;
  }

  .email-row {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 3px;
    padding: 10px 12px;
  }

  .row-sender {
    grid-column: 2;
    grid-row: 1;
  }

  .row-meta {
    grid-column: 3;
    grid-row: 1;
  }

  .row-main {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .row-subject {
    max-width: 100%;
  }

  .row-snippet {
    display: none;
  }

  .thread-content {
    padding: 16px 16px 96px;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    min-height: 0;
    flex-wrap: wrap;
    padding: max(6px, env(safe-area-inset-top)) 10px 8px;
    gap: 6px;
  }

  .topbar-left {
    gap: 2px;
  }

  .brand-logo {
    gap: 7px;
    padding: 2px 4px;
  }

  .brand-mark {
    width: 26px;
    height: 20px;
  }

  .brand-text {
    font-size: 18px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  #aboutBtn {
    display: none;
  }

  .topbar-right {
    gap: 4px;
  }

  .lang-picker-pill {
    height: 32px;
    padding: 0 7px;
    gap: 3px;
  }

  .lang-picker-pill .material-symbols-outlined {
    font-size: 15px;
  }

  .tmail-lang-select {
    max-width: 118px;
    font-size: 12px;
  }

  .avatar-ring {
    width: 32px;
    height: 32px;
  }

  .search-form {
    order: 3;
    flex: 1 0 100%;
    max-width: none;
    height: 40px;
    padding: 0 8px 0 4px;
  }

  .search-input {
    font-size: 16px;
  }

  .apps-menu {
    width: min(272px, calc(100vw - 20px));
  }

  .profile-menu {
    width: min(300px, calc(100vw - 20px));
  }

  .workspace {
    padding: 0 4px 4px;
  }

  .main-card {
    border-radius: 14px;
  }

  .list-toolbar {
    flex-wrap: nowrap;
    padding: 7px 10px;
    gap: 6px;
  }

  .toolbar-left {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 2px 0;
  }

  .toolbar-left::-webkit-scrollbar {
    display: none;
  }

  .toolbar-right {
    display: none;
  }

  .tool-btn, .select-pill {
    height: 32px;
    flex-shrink: 0;
  }

  .select-pill select {
    font-size: 12.5px;
  }

  .pill-badge-new {
    position: static;
    padding: 1px 5px;
    font-size: 9px;
  }

  .category-tabs {
    padding: 0 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .cat-tab {
    min-width: auto;
    max-width: none;
    flex: 0 0 auto;
    padding: 9px 11px;
    gap: 7px;
  }

  .cat-tab-title {
    font-size: 12.5px;
  }

  .cat-tab-sub {
    display: none;
  }

  .email-list {
    padding-bottom: 92px;
  }

  .email-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 3px 6px;
    padding: 10px 10px;
    align-items: start;
  }

  .row-controls {
    padding-top: 1px;
  }

  .star-btn {
    padding: 2px;
    font-size: 11px;
  }

  .row-sender {
    font-size: 13px;
  }

  .row-date {
    min-width: 0;
    font-size: 11px;
  }

  .attach-pill {
    font-size: 11px;
  }

  .row-main {
    flex-wrap: wrap;
    row-gap: 4px;
    overflow: visible;
  }

  .row-subject {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.38;
    font-size: 13px;
    flex-basis: 100%;
  }

  .thread-toolbar {
    padding: 6px 8px;
    gap: 6px;
  }

  .thread-toolbar-left, .thread-toolbar-right {
    gap: 4px;
    flex-wrap: wrap;
  }

  .verified-pill {
    height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .thread-content {
    padding: 14px 12px 96px;
  }

  .thread-subject {
    font-size: 18px;
  }

  .thread-msg-card {
    gap: 10px;
    padding: 14px 0;
  }

  .msg-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .msg-text {
    font-size: 13.5px;
    line-height: 1.6;
  }

  .msg-attachments {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 8px;
  }

  .att-thumb {
    height: 96px;
  }

  .thread-footer-actions {
    gap: 7px;
  }

  .gmail-reply-btn {
    height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
    gap: 6px;
  }

  .subapp-pane {
    padding: 14px 12px 96px;
  }

  .subapp-head {
    gap: 10px;
    margin-bottom: 14px;
  }

  .subapp-title {
    font-size: 17px;
  }

  .subapp-search {
    width: 100%;
    font-size: 16px;
    height: 40px;
  }

  .photos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .photo-card img {
    height: 112px;
  }

  .activity-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric-card {
    padding: 11px 12px;
  }

  .metric-num {
    font-size: 19px;
  }

  .activity-charts,
  .drive-grid,
  .people-dir-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .floating-dock {
    bottom: max(8px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 12px);
    padding: 5px 6px;
    gap: 2px;
    border-radius: 18px;
  }

  .dock-btn {
    padding: 3px 5px;
    gap: 2px;
    border-radius: 11px;
  }

  .dock-ico {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .dock-ico .material-symbols-outlined {
    font-size: 18px;
  }

  .dock-label {
    font-size: 9.5px;
  }

  .dock-badge {
    font-size: 8px;
    padding: 0 4px;
    top: -1px;
    right: 0;
  }

  .modal-overlay, .lightbox {
    padding: 10px;
  }

  .modal-card {
    padding: 16px 16px;
    border-radius: 16px;
    max-height: 88dvh;
  }

  .lightbox-card {
    border-radius: 14px;
    max-height: 92dvh;
  }

  .lightbox-head {
    padding: 10px 12px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 68px));
    text-align: center;
  }
}
