
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-soft: #f1f3f4;
  --surface-strong: #e8f0fe;
  --text: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --brand: #1a73e8;
  --brand-dark: #1557b0;
  --brand-soft: #d2e3fc;
  --danger: #d93025;
  --success: #188038;
  --shadow: 0 1px 2px rgba(60,64,67,.15), 0 2px 6px rgba(60,64,67,.1);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
code {
  background: #f1f3f4;
  border-radius: 8px;
  padding: 2px 6px;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: fit-content;
}
.brand-text {
  font-size: 22px;
  font-weight: 600;
  color: #5f6368;
}
.brand-mark {
  width: 26px;
  height: 32px;
  border-radius: 5px;
  background: linear-gradient(180deg, #4c8bf5, #1a73e8);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}
.brand-mark span {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
}
.brand-mark span:nth-child(1) { top: 9px; }
.brand-mark span:nth-child(2) { top: 15px; }
.brand-mark span:nth-child(3) { top: 21px; }

.topbar-search {
  min-width: min(720px, 42vw);
  height: 48px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
}
.topbar-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #5f6368;
  color: #fff;
  font-weight: 700;
}
.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-meta strong { font-size: 14px; }
.user-meta small { color: var(--muted); font-size: 12px; }
.small-pill {
  border-radius: 999px;
  padding: 10px 16px;
}

.landing-shell {
  width: min(1320px, calc(100% - 48px));
  margin: 28px auto 48px;
}
.landing-grid {
  display: grid;
  grid-template-columns: 1fr minmax(420px, 560px);
  gap: 34px;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.02;
  margin: 10px 0 18px;
  max-width: 720px;
}
.hero-copy p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  max-width: 700px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 18px;
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 10px;
}
.feature-list li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.feature-list li::before {
  content: '✓';
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
}

.hero-preview {
  min-height: 680px;
  display: flex;
  align-items: center;
}
.preview-browser {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(60,64,67,.16);
  overflow: hidden;
}
.browser-dots {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
}
.mini-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.mini-brand { font-weight: 600; color: #5f6368; }
.mini-search {
  flex: 1;
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--muted);
}
.mini-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
  font-weight: 700;
}
.preview-content {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 560px;
}
.preview-sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px 16px;
}
.side-chip {
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
}
.side-chip.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.preview-main {
  padding: 20px;
  background: #fcfcfd;
}
.preview-cards {
  display: grid;
  grid-template-columns: 160px repeat(2, 1fr);
  gap: 16px;
}
.blank-doc-card, .recent-doc-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  padding: 14px;
}
.blank-doc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 190px;
}
.blank-doc-icon, .template-sheet, .doc-file-icon {
  width: 46px;
  height: 60px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #eef3fd);
  border: 1px solid #c7d2fe;
  position: relative;
  box-shadow: inset 0 -12px 0 0 rgba(26,115,232,.08);
}
.blank-doc-icon::before, .template-sheet::before, .doc-file-icon::before {
  content: '';
  position: absolute;
  left: 9px;
  right: 9px;
  top: 16px;
  height: 2px;
  background: #8ab4f8;
  box-shadow: 0 8px 0 #8ab4f8, 0 16px 0 #8ab4f8;
}
.recent-doc-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recent-doc-card small { color: var(--muted); }
.recent-doc-thumb, .doc-thumb {
  height: 100px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0, #f6fafe 100%);
  border: 1px solid var(--line);
  position: relative;
}
.lines::before, .doc-thumb-lines::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 16px;
  height: 2px;
  background: #c2dafc;
  box-shadow: 0 10px 0 #c2dafc, 0 20px 0 #c2dafc, 0 30px 0 #c2dafc, 0 40px 0 #c2dafc;
}
.preview-editor-mock {
  margin-top: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}
.mock-title { font-size: 20px; font-weight: 600; }
.mock-ruler {
  height: 22px;
  background: linear-gradient(90deg, #f1f3f4 0 8%, #fff 8% 92%, #f1f3f4 92%);
  border-radius: 8px;
  margin: 16px 0;
}
.mock-paper {
  min-height: 220px;
  background: linear-gradient(180deg, #fff 0%, #fff 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shell, .doc-app-shell {
  width: min(1320px, calc(100% - 42px));
  margin: 24px auto 40px;
}
.narrow { width: min(760px, calc(100% - 32px)); }
.welcome-row { margin-bottom: 24px; }
.eyebrow {
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
}
h1, h2, h3, p { margin-top: 0; }
.welcome-row h1 { margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.helper-note { padding-left: 4px; }

.panel, .light-panel, .panel-flat, .error-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.panel, .light-panel, .error-panel { padding: 22px; }
.panel-flat { padding: 18px 20px 22px; }
.error-panel { text-align: center; padding: 40px 28px; }
.empty-state p { margin: 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.template-grid, .docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.template-form { margin: 0; }
.template-card, .doc-google-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.template-card:hover, .doc-google-card:hover {
  transform: translateY(-2px);
  border-color: #aecbfa;
  box-shadow: 0 10px 24px rgba(60,64,67,.16);
}
.doc-google-card { min-height: 220px; }
.doc-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.doc-card-body span, .doc-card-body small { color: var(--muted); }
.dashboard-section + .dashboard-section { margin-top: 26px; }

.button, button {
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}
.button:hover, button:hover { filter: brightness(.98); }
.button.primary, .primary {
  background: var(--brand);
  color: white;
}
.button.primary:hover, .primary:hover {
  background: var(--brand-dark);
}
.button.secondary {
  background: white;
  border-color: var(--line);
}
.large { padding: 13px 18px; }
.ghost, .ghost-link {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
}
.ghost:hover, .ghost-link:hover { background: #f8f9fa; }
.small-button { padding: 8px 12px; }
.danger {
  background: #fce8e6;
  color: var(--danger);
  border-color: #fad2cf;
}
.danger:hover { background: #f9d7d4; }

.doc-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.doc-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.doc-header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.doc-subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.title-input {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  outline: none;
}
.top-title-input {
  font-size: 30px;
  font-weight: 700;
  min-width: 220px;
  max-width: min(70vw, 720px);
}
.title-input:focus {
  border-color: #aecbfa;
  background: white;
}
.editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
.editor-column { min-width: 0; }
.editor-toolbar-google {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.toolbar-chip, .toolbar-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
}
.toolbar-chip:hover, .toolbar-icon:hover {
  background: var(--surface-soft);
}
.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}
.notice {
  border: 1px solid #f6c56d;
  background: #fff8e1;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  color: #8d6b00;
}
.paper-panel {
  background: #eef2f7;
  border-radius: 20px;
  padding: 28px 20px;
  border: 1px solid #dde3ea;
}
.doc-paper-editor {
  display: block;
  width: min(100%, 880px);
  min-height: 960px;
  margin: 0 auto;
  background: white;
  color: #202124;
  border: 1px solid #d6d9de;
  border-radius: 2px;
  padding: 72px 80px;
  line-height: 1.75;
  font-size: 16px;
  resize: vertical;
  box-shadow: 0 1px 3px rgba(60,64,67,.2);
  outline: none;
}
.doc-paper-editor:focus { border-color: #aecbfa; }
.doc-sidebar {
  display: grid;
  gap: 18px;
}
.share-form {
  display: grid;
  gap: 10px;
}
.share-form label {
  color: var(--muted);
  font-size: 13px;
}
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
}
input:focus, select:focus { border-color: #aecbfa; }
.share-list { display: grid; gap: 10px; }
.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.share-row small { display: block; color: var(--muted); }
.preview-panel { overflow: hidden; }
.preview {
  color: #202124;
  line-height: 1.75;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.preview h1, .preview h2, .preview h3 { margin-top: 0; }
.preview pre {
  background: #f8f9fa;
  padding: 14px;
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
}
.preview blockquote {
  border-left: 4px solid var(--brand);
  margin-left: 0;
  padding-left: 16px;
  color: var(--muted);
}
.preview table {
  width: 100%;
  border-collapse: collapse;
}
.preview table td, .preview table th {
  border: 1px solid var(--line);
  padding: 8px 10px;
}

@media (max-width: 1180px) {
  .landing-grid, .editor-shell { grid-template-columns: 1fr; }
  .hero-preview { min-height: auto; }
}

@media (max-width: 920px) {
  .topbar {
    height: auto;
    padding: 12px 14px;
    flex-wrap: wrap;
  }
  .topbar-left, .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .topbar-search {
    min-width: 0;
    flex: 1;
  }
  .preview-content { grid-template-columns: 1fr; }
  .preview-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-cards { grid-template-columns: 1fr; }
  .doc-header-row, .doc-header-left {
    align-items: flex-start;
    flex-direction: column;
  }
  .top-title-input {
    max-width: 100%;
    font-size: 24px;
  }
  .doc-paper-editor {
    padding: 32px 24px;
    min-height: 720px;
  }
}

@media (max-width: 640px) {
  .landing-shell, .shell, .doc-app-shell {
    width: min(100% - 20px, 1000px);
  }
  .hero-copy h1 {
    font-size: 34px;
  }
  .user-pill {
    width: 100%;
    justify-content: space-between;
  }
  .doc-paper-editor {
    padding: 26px 18px;
  }
}


/* Extynct Docs WYSIWYG update */
.google-doc-real {
  width: min(1500px, calc(100% - 32px));
}
.doc-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.real-doc-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 12px;
  background: #edf2fa;
  border: 1px solid #d7dde8;
  border-radius: 999px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  position: sticky;
  top: 84px;
  z-index: 15;
}
.toolbar-select {
  width: auto;
  min-width: 150px;
  height: 36px;
  border-radius: 9px;
  background: #fff;
  padding: 0 10px;
}
.real-doc-toolbar .toolbar-icon {
  min-height: 36px;
  border: 1px solid transparent;
  background: transparent;
  color: #3c4043;
  padding: 7px 10px;
  border-radius: 9px;
}
.real-doc-toolbar .toolbar-icon:hover,
.real-doc-toolbar .toolbar-icon.active {
  background: #dfe7f5;
  color: #174ea6;
}
.strong-icon { font-weight: 800; }
.italic-icon { font-style: italic; }
.underline-icon { text-decoration: underline; }
.full-width-notice {
  margin-bottom: 14px;
}
.real-editor-stage {
  min-height: calc(100vh - 180px);
  background: #edf2f7;
  border: 1px solid #dbe1ea;
  border-radius: 22px;
  padding: 34px 18px 80px;
  overflow-x: auto;
}
.doc-page-editor {
  width: min(100%, 920px);
  min-height: 1120px;
  margin: 0 auto;
  background: #fff;
  color: #202124;
  border: 1px solid #d6d9de;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(60,64,67,.2), 0 10px 26px rgba(60,64,67,.08);
  padding: 82px 92px;
  line-height: 1.72;
  font-size: 16px;
  outline: none;
}
.doc-page-editor:focus {
  border-color: #aecbfa;
}
.doc-page-editor p {
  margin: 0 0 12px;
}
.doc-page-editor h1 {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 18px;
  font-weight: 700;
}
.doc-page-editor h2 {
  font-size: 26px;
  line-height: 1.25;
  margin: 22px 0 12px;
  font-weight: 700;
}
.doc-page-editor h3 {
  font-size: 20px;
  line-height: 1.35;
  margin: 18px 0 10px;
  font-weight: 700;
}
.doc-page-editor ul,
.doc-page-editor ol {
  padding-left: 30px;
  margin: 0 0 12px;
}
.doc-page-editor blockquote {
  margin: 16px 0;
  padding-left: 16px;
  border-left: 4px solid var(--brand);
  color: #4d5156;
}
.doc-page-editor pre {
  background: #f8f9fa;
  border: 1px solid #e0e3e7;
  border-radius: 10px;
  padding: 14px;
  white-space: pre-wrap;
}
.doc-page-editor a {
  color: #1a73e8;
  text-decoration: underline;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32,33,36,.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-backdrop.open {
  display: flex;
}
.share-modal {
  width: min(620px, 100%);
  max-height: min(760px, 90vh);
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(32,33,36,.32);
  padding: 24px;
}
.share-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.share-modal-head h2 {
  margin-bottom: 6px;
}
.share-modal-head p {
  margin-bottom: 0;
}
.editor-shell,
.editor-column,
.doc-sidebar,
.preview-panel,
.editor-toolbar-google,
.paper-panel,
.doc-paper-editor {
  /* old editor layout is intentionally bypassed by the new doc page */
}

@media (max-width: 900px) {
  .real-doc-toolbar {
    border-radius: 18px;
    top: 118px;
  }
  .doc-page-editor {
    padding: 42px 28px;
    min-height: 820px;
  }
  .real-editor-stage {
    padding: 18px 10px 48px;
  }
}

@media (max-width: 560px) {
  .google-doc-real {
    width: min(100% - 16px, 1500px);
  }
  .real-doc-toolbar {
    position: static;
  }
  .doc-page-editor {
    padding: 32px 18px;
  }
  .share-modal {
    padding: 18px;
  }
}


/* Markdown auto-format update */
.doc-page-editor h4 {
  font-size: 18px;
  line-height: 1.35;
  margin: 16px 0 8px;
  font-weight: 700;
}
.doc-page-editor h5,
.doc-page-editor h6 {
  font-size: 16px;
  line-height: 1.35;
  margin: 14px 0 8px;
  font-weight: 700;
}
.doc-page-editor hr {
  border: 0;
  border-top: 1px solid #dadce0;
  margin: 24px 0;
}
.doc-page-editor code {
  background: #f1f3f4;
  border-radius: 6px;
  padding: 2px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .92em;
}


/* Dashboard polish update */
:root {
  --bg: #101314;
  --surface: #15191b;
  --surface-soft: #1c2225;
  --surface-strong: #202830;
  --text: #eef2f5;
  --muted: #a9b1b8;
  --line: #2c3439;
  --brand: #2f81f7;
  --brand-dark: #1f6feb;
  --brand-soft: rgba(47,129,247,.14);
  --danger: #ff6b6b;
  --shadow: 0 16px 40px rgba(0,0,0,.25);
}

body {
  background:
    radial-gradient(circle at 20% -10%, rgba(47,129,247,.15), transparent 28%),
    linear-gradient(180deg, #111517 0%, #0f1314 100%);
}

.topbar {
  background: rgba(17,20,22,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-text {
  color: #d7dde2;
  font-weight: 700;
}

.topbar-search {
  background: #1b2023;
  border: 1px solid transparent;
  transition: border-color .15s ease, background .15s ease;
}

.topbar-search:focus-within {
  background: #20262a;
  border-color: rgba(47,129,247,.55);
}

.topbar-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
  padding: 0;
}

.topbar-search input::placeholder,
.dashboard-filter-card input::placeholder {
  color: #7f888f;
}

.avatar-circle,
.hero-avatar {
  background: linear-gradient(135deg, #3b4650, #59636d);
  color: #fff;
}

.user-meta strong {
  color: var(--text);
}

.user-meta small {
  color: var(--muted);
}

.ghost,
.ghost-link {
  background: transparent;
  border-color: var(--line);
  color: #c9d1d9;
}

.ghost:hover,
.ghost-link:hover {
  background: var(--surface-soft);
}

.shell.polished-dashboard {
  width: min(1220px, calc(100% - 42px));
  margin: 20px auto 56px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(47,129,247,.14), transparent 48%),
    rgba(21,25,27,.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-profile-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.hero-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.dashboard-hero h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
}

.new-doc-form {
  margin: 0;
  flex: 0 0 auto;
}

.new-doc-button {
  min-height: 46px;
  padding: 0 18px;
  gap: 10px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(31,111,235,.24);
}

.new-doc-button span {
  font-size: 20px;
  line-height: 1;
}

.dashboard-stats-row {
  display: grid;
  grid-template-columns: 150px 150px minmax(260px, 1fr);
  gap: 14px;
  margin: 16px 0 26px;
}

.stat-card,
.dashboard-filter-card {
  border: 1px solid var(--line);
  background: rgba(21,25,27,.82);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
}

.stat-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card strong {
  font-size: 28px;
  line-height: 1;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-filter-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.dashboard-filter-card svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: 0 0 auto;
}

.dashboard-filter-card input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
  padding: 16px 0;
}

.clean-head {
  margin: 0 0 14px;
}

.clean-head h2 {
  margin: 0;
  font-size: 22px;
}

.clean-head span {
  color: var(--muted);
}

.polished-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 16px;
}

.polished-doc-card {
  min-height: 168px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 100%),
    rgba(21,25,27,.92);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.polished-doc-card:hover {
  transform: translateY(-3px);
  border-color: rgba(47,129,247,.65);
  background:
    linear-gradient(180deg, rgba(47,129,247,.08), transparent 100%),
    rgba(24,29,32,.95);
}

.doc-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.doc-mini-icon {
  width: 34px;
  height: 42px;
  border-radius: 8px;
  background: rgba(47,129,247,.14);
  border: 1px solid rgba(47,129,247,.44);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  flex: 0 0 auto;
}

.doc-mini-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #58a6ff;
}

.doc-owner-pill {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  text-transform: capitalize;
}

.doc-card-title {
  color: var(--text);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.25;
  word-break: break-word;
}

.doc-card-preview {
  color: #c5ccd3;
  line-height: 1.45;
  font-size: 13px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 12px;
}

.clean-empty {
  background: rgba(21,25,27,.8);
  border-color: var(--line);
  box-shadow: none;
  color: var(--muted);
}

.hidden,
.search-hidden {
  display: none !important;
}

/* Keep the actual editor paper readable even with the dark dashboard theme. */
.doc-paper-editor {
  background: #fff;
  color: #202124;
}

.paper-panel {
  background: #dfe4ea;
}

.light-panel,
.preview-panel {
  background: var(--surface);
  color: var(--text);
}

input,
select {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--line);
}

input:focus,
select:focus {
  border-color: rgba(47,129,247,.72);
}

@media (max-width: 900px) {
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .new-doc-form,
  .new-doc-button {
    width: 100%;
  }

  .dashboard-stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-filter-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .dashboard-stats-row {
    grid-template-columns: 1fr;
  }

  .polished-doc-grid {
    grid-template-columns: 1fr;
  }

  .doc-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}


/* Dark mode editor refinement update */
.google-doc-real {
  width: min(1500px, calc(100% - 32px));
}

.doc-header-row {
  padding: 8px 0 2px;
}

.top-title-input {
  color: #f3f6fb;
}

.top-title-input:focus {
  background: rgba(255,255,255,.04);
  border-color: rgba(47,129,247,.55);
}

.doc-subline {
  color: #aeb8c2;
}

.real-doc-toolbar {
  background: rgba(20,25,31,.94);
  border: 1px solid #2b3440;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}

.toolbar-divider {
  background: #2f3945;
}

.toolbar-select {
  width: auto;
  min-width: 168px;
  height: 38px;
  border-radius: 10px;
  background: #141a22;
  color: #eef2f6;
  border: 1px solid #2d3742;
  padding: 0 12px;
  appearance: auto;
}

.toolbar-select:focus {
  border-color: rgba(47,129,247,.76);
  outline: none;
  box-shadow: 0 0 0 3px rgba(47,129,247,.18);
}

.toolbar-select option,
select option {
  background: #11161d;
  color: #eef2f6;
}

.real-doc-toolbar .toolbar-icon {
  color: #d3d9e0;
}

.real-doc-toolbar .toolbar-icon:hover,
.real-doc-toolbar .toolbar-icon.active {
  background: #1f2935;
  color: #58a6ff;
}

.notice.full-width-notice {
  background: rgba(250,173,20,.12);
  border-color: rgba(250,173,20,.34);
  color: #ffd666;
}

.real-editor-stage {
  min-height: calc(100vh - 180px);
  background:
    radial-gradient(circle at 50% 0%, rgba(47,129,247,.08), transparent 34%),
    linear-gradient(180deg, #11161d 0%, #0c1117 100%);
  border: 1px solid #2a333d;
}

.doc-page-editor {
  background: linear-gradient(180deg, #151b23 0%, #121820 100%);
  color: #edf2f7;
  border: 1px solid #303944;
  box-shadow: 0 2px 10px rgba(0,0,0,.34), 0 18px 42px rgba(0,0,0,.26);
  caret-color: #58a6ff;
}

.doc-page-editor:focus {
  border-color: rgba(88,166,255,.6);
}

.doc-page-editor p,
.doc-page-editor li,
.doc-page-editor div {
  color: #edf2f7;
}

.doc-page-editor h1,
.doc-page-editor h2,
.doc-page-editor h3,
.doc-page-editor h4,
.doc-page-editor h5,
.doc-page-editor h6 {
  color: #ffffff;
}

.doc-page-editor blockquote {
  color: #b8c4cf;
  border-left-color: #58a6ff;
}

.doc-page-editor pre {
  background: #0f141a;
  border-color: #2c3540;
  color: #eef2f7;
}

.doc-page-editor code {
  background: #0f141a;
  color: #d2e4ff;
}

.doc-page-editor hr {
  border-top-color: #2d3742;
}

.doc-page-editor a {
  color: #79b8ff;
}

.share-modal {
  background: #141a22;
  border-color: #2c3540;
  color: #eef2f7;
}

.share-row {
  background: #11161d;
  border-color: #2c3540;
}

.share-row small,
.share-modal .muted,
.share-modal-head p {
  color: #a8b3bd;
}

.share-modal code {
  background: #0f141a;
  color: #d6e6ff;
}

input,
select,
textarea {
  background: #161c24;
  color: #eef2f7;
  border-color: #2d3742;
}

input::placeholder,
textarea::placeholder,
select.placeholder {
  color: #94a0ab;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47,129,247,.78);
  box-shadow: 0 0 0 3px rgba(47,129,247,.16);
}

button.danger {
  background: rgba(255,107,107,.12);
  color: #ff8f8f;
  border-color: rgba(255,107,107,.28);
}

button.danger:hover {
  background: rgba(255,107,107,.18);
}


/* Landing page polish fix */
.landing-shell {
  width: min(1340px, calc(100% - 52px));
  margin: 34px auto 64px;
}

.hero-copy {
  max-width: 700px;
}

.hero-copy h1 {
  color: #f5f8fc;
  text-wrap: balance;
}

.hero-copy p {
  color: #c3ccd4;
}

.hero-actions {
  gap: 14px;
}

.button.secondary {
  background: rgba(255,255,255,.03);
  color: #e7edf5;
  border-color: #2b3440;
}

.button.secondary:hover {
  background: rgba(255,255,255,.06);
}

.feature-list {
  margin-top: 26px;
}

.feature-list li {
  color: #edf2f7;
}

.feature-list li::before {
  background: rgba(47,129,247,.18);
  color: #66a8ff;
}

.hero-preview {
  min-height: 720px;
}

.preview-browser {
  background: linear-gradient(180deg, #11161d 0%, #0d1218 100%);
  border: 1px solid #2b3440;
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
}

.browser-dots,
.mini-toolbar,
.preview-sidebar,
.preview-main,
.preview-editor-mock,
.blank-doc-card,
.recent-doc-card {
  background: transparent;
}

.browser-dots {
  border-bottom-color: #2b3440;
}

.browser-dots span {
  background: #5d6670;
}

.mini-toolbar {
  padding: 16px 18px;
  border-bottom: 1px solid #2b3440;
}

.mini-brand {
  color: #e5ebf2;
}

.mini-search {
  background: #171d24;
  color: #95a1ad;
  border: 1px solid #2d3742;
}

.mini-avatar {
  background: #2f81f7;
}

.preview-content {
  min-height: 600px;
}

.preview-sidebar {
  border-right: 1px solid #2b3440;
}

.side-chip {
  color: #94a0ab;
}

.side-chip.active {
  background: rgba(47,129,247,.16);
  color: #77b0ff;
}

.preview-main {
  background: linear-gradient(180deg, rgba(255,255,255,.01), transparent 100%);
}

.blank-doc-card,
.recent-doc-card,
.preview-editor-mock {
  border: 1px solid #2d3742;
  background: rgba(21,27,35,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

.blank-doc-card span,
.recent-doc-card strong,
.mock-title {
  color: #edf2f7;
}

.recent-doc-card small {
  color: #9ca8b4;
}

.recent-doc-thumb,
.mock-paper {
  border-color: #2d3742;
  background: linear-gradient(180deg, #121923 0%, #0f141b 100%);
}

.blank-doc-icon,
.doc-file-icon {
  background: linear-gradient(180deg, #1f2834, #17202c);
  border-color: #3a4a5f;
  box-shadow: inset 0 -12px 0 0 rgba(47,129,247,.12);
}

.blank-doc-icon::before,
.doc-file-icon::before {
  background: #72afff;
  box-shadow: 0 8px 0 #72afff, 0 16px 0 #72afff;
}

.lines::before,
.doc-thumb-lines::before {
  background: #4d6f98;
  box-shadow: 0 10px 0 #4d6f98, 0 20px 0 #4d6f98, 0 30px 0 #4d6f98, 0 40px 0 #4d6f98;
}

.mock-ruler {
  background: linear-gradient(90deg, #161c24 0 8%, #0f141b 8% 92%, #161c24 92%);
}

.mock-paper {
  position: relative;
  overflow: hidden;
}

.mock-paper::before {
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  top: 24px;
  height: 2px;
  background: #2e3c4d;
  box-shadow:
    0 18px 0 #2e3c4d,
    0 36px 0 #2e3c4d,
    0 54px 0 #2e3c4d,
    0 72px 0 #2e3c4d,
    0 90px 0 #2e3c4d,
    0 108px 0 #2e3c4d;
  opacity: .95;
}

@media (max-width: 1180px) {
  .landing-grid {
    gap: 24px;
  }

  .hero-preview {
    min-height: auto;
  }
}


/* Landing preview unsquish update */
.landing-grid {
  grid-template-columns: minmax(0, 1fr) minmax(620px, 760px);
  gap: 42px;
  align-items: center;
}

.hero-preview {
  min-height: auto;
  align-items: center;
  justify-content: flex-end;
}

.preview-browser {
  width: min(100%, 760px);
  margin-left: auto;
  border-radius: 30px;
}

.preview-content {
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 520px;
}

.preview-sidebar {
  padding: 18px 16px;
}

.preview-main {
  padding: 20px 18px 18px;
}

.preview-cards {
  grid-template-columns: minmax(170px, 1.25fr) minmax(120px, .9fr) minmax(120px, .9fr);
  gap: 14px;
  align-items: stretch;
}

.blank-doc-card,
.recent-doc-card {
  min-height: 150px;
}

.blank-doc-card {
  padding: 16px;
}

.blank-doc-card span,
.recent-doc-card strong,
.recent-doc-card small {
  word-break: normal;
  overflow-wrap: anywhere;
}

.recent-doc-card {
  padding: 14px 12px;
}

.recent-doc-thumb,
.doc-thumb {
  height: 88px;
}

.preview-editor-mock {
  margin-top: 18px;
  padding: 16px;
}

.mock-title {
  font-size: 18px;
}

.mock-paper {
  min-height: 165px;
}

@media (max-width: 1280px) {
  .landing-grid {
    grid-template-columns: minmax(0, 1fr) minmax(520px, 650px);
    gap: 28px;
  }

  .preview-cards {
    grid-template-columns: minmax(155px, 1.2fr) minmax(110px, .85fr) minmax(110px, .85fr);
  }
}

@media (max-width: 1180px) {
  .landing-grid {
    grid-template-columns: 1fr;
  }

  .hero-preview {
    justify-content: center;
  }

  .preview-browser {
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  .preview-content {
    grid-template-columns: 1fr;
  }

  .preview-sidebar {
    border-right: 0;
    border-bottom: 1px solid #2b3440;
  }

  .preview-cards {
    grid-template-columns: 1fr;
  }
}


/* Text size toolbar update */
.toolbar-size-select {
  min-width: 78px;
  max-width: 88px;
  text-align: center;
}

.doc-page-editor span[style*="font-size"] {
  line-height: inherit;
}
