/* Intent: a product critique at a long white table — dense work, one next step.
   Signature: white field, one blue for action, four product dots never used as a wash.
   Constraint: no rainbow gradients, no card around every row, no copied logo artwork. */
:root {
  --ink: #202124;
  --muted: #5f6368;
  --line: #e8eaed;
  --canvas: #f8f9fa;
  --white: #fff;
  --blue: #1a73e8;
  --blue-deep: #174ea6;
  --red: #ea4335;
  --yellow: #f9ab00;
  --green: #188038;
  --amber: #b06000;
  --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { background: #e8eaed; }
body {
  margin: 0;
  min-height: 100vh;
  background: #e8eaed;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: transparent; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.app-shell, .detail-view {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--canvas);
}
.app-shell { padding-bottom: calc(64px + var(--safe)); }
.top-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 56px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand { padding: 0; }
.brand img { display: block; width: 132px; height: 28px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions button {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}
.top-actions svg { width: 20px; height: 20px; }
.top-actions b, .bottom-nav b {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}
.mini-avatar {
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.page { display: none; }
.page.active { display: block; }
.today-head { padding: 18px 16px 8px; background: var(--white); }
.today-head span, .page-head span, .section-title span, .profile-head span, .office-line span, .focus-band span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.today-head h1 { margin: 4px 0 2px; font-size: 28px; line-height: 1.15; font-weight: 650; }
.today-head p, .page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.focus-band, .office-line {
  margin: 8px 16px 0;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.focus-band strong, .office-line strong { display: block; margin-top: 2px; font-size: 15px; }
.focus-band small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.focus-band button, .detail-action, .compose {
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}
.metric-grid {
  margin: 12px 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.metric-grid div { padding: 10px 6px; text-align: center; }
.metric-grid strong { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.metric-grid span { color: var(--muted); font-size: 10px; }
.metric-grid .green strong { color: var(--green); }
.metric-grid .amber strong { color: var(--amber); }
.section-block { margin-top: 8px; }
.section-title, .page-head {
  padding: 8px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.page-head { padding-top: 14px; background: var(--white); }
.page-head h1, .section-title h2 { margin: 2px 0 0; font-size: 26px; font-weight: 650; }
.section-title h2 { font-size: 18px; }
.section-title button { color: var(--blue); font-size: 13px; font-weight: 650; }
.priority-row, .schedule-row, .work-card, .mail-row, .menu-row {
  width: 100%;
  display: grid;
  text-align: left;
}
.priority-row, .schedule-row {
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.priority-row time, .schedule-row time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.priority-row strong, .schedule-row strong, .work-card strong, .mail-copy h3 { display: block; font-size: 14px; }
.priority-row small, .schedule-row small, .work-card small, .mail-copy p { color: var(--muted); font-size: 12px; }
.priority-row em, .schedule-row em { font-style: normal; color: var(--blue); font-size: 10px; font-weight: 700; }
.priority-row b, .work-card b {
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
}
.priority-row b.amber, .work-card b.amber { color: var(--amber); }
.priority-row b.green { color: var(--green); }
.filter-rail {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.filter-rail button {
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.filter-rail button.active { background: var(--ink); color: #fff; }
.work-list, #productList, #reviewList { display: grid; gap: 0; }
.work-card {
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.work-card em { font-style: normal; color: var(--muted); font-size: 11px; }
.mail-head { align-items: center; padding-bottom: 4px; }
.mail-head h1 { font-size: 26px; }
.compose { display: inline-flex; align-items: center; gap: 6px; }
.compose svg { width: 16px; height: 16px; }
.search-field {
  margin: 0 16px 8px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}
.search-field svg { width: 16px; height: 16px; color: var(--muted); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; }
.mail-list { background: var(--white); }
.mail-row {
  grid-template-columns: 1fr 28px;
  gap: 8px;
  align-items: center;
  min-height: 96px;
  padding: 8px 12px 8px 16px;
  border-bottom: 1px solid var(--line);
}
.mail-open {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
}
.mail-row.unread { background: #f3f8fe; }
.mail-avatar, .profile-avatar, .person-card div, .mail-detail-sender span {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}
.mail-avatar { width: 36px; height: 36px; font-size: 12px; }
.mail-copy { min-width: 0; }
.mail-copy span { display: flex; align-items: center; gap: 6px; }
.mail-copy strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.mail-copy time, .mail-copy small { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.mail-copy h3 { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mail-copy p {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}
.mail-star { color: #bdc1c6; }
.mail-star.active { color: var(--yellow); }
.mail-star svg { width: 18px; height: 18px; }
.profile-head {
  padding: 20px 16px 12px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  background: var(--white);
}
.profile-avatar { width: 64px; height: 64px; font-size: 26px; }
.profile-head h1 { margin: 2px 0; font-size: 24px; }
.profile-head p { margin: 0; color: var(--muted); font-size: 13px; }
.menu-row {
  grid-template-columns: 22px 1fr 16px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.menu-row svg { width: 18px; height: 18px; color: var(--blue); }
.menu-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.bottom-nav {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: 0;
  width: min(430px, 100%);
  height: calc(58px + var(--safe));
  padding-bottom: var(--safe);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  transform: translateX(-50%);
  background: var(--white);
  border-top: 1px solid var(--line);
}
.bottom-nav button {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
}
.bottom-nav svg { width: 20px; height: 20px; }
.bottom-nav button.active { color: var(--blue); }
.bottom-nav b { top: 4px; right: 18px; }
.detail-view {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
}
.detail-view[hidden] { display: none; }
.detail-view header {
  height: 56px;
  padding: 0 8px;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.detail-view header button { width: 40px; height: 40px; display: grid; place-items: center; }
.detail-view h2 { margin: 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
#detailContent { overflow: auto; padding: 16px 16px calc(24px + var(--safe)); }
.detail-hero h1, .mail-detail h1, .person-card h1 { margin: 8px 0; font-size: 24px; line-height: 1.2; }
.detail-hero p, .mail-detail p, .person-card p { white-space: pre-wrap; color: var(--muted); font-size: 14px; line-height: 1.5; }
.detail-grid { display: grid; gap: 10px; margin: 12px 0; }
.detail-grid div { padding-top: 10px; border-top: 1px solid var(--line); }
.detail-grid small { display: block; color: var(--muted); font-size: 11px; }
.detail-grid strong { display: block; margin-top: 2px; font-size: 14px; }
.detail-block ul { margin: 8px 0 0; padding-left: 18px; }
.detail-block li { margin: 6px 0; font-size: 14px; }
.detail-action { width: 100%; margin-top: 16px; }
.person-card div, .mail-detail-sender span { width: 56px; height: 56px; font-size: 22px; }
.mail-detail-sender { display: flex; align-items: center; gap: 10px; }
.attachment {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
}
.sheet-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  align-items: end;
}
.sheet-layer[hidden] { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(32, 33, 36, 0.4); }
.action-sheet {
  position: relative;
  padding: 16px 16px calc(16px + var(--safe));
  background: var(--white);
  border-radius: 16px 16px 0 0;
}
.action-sheet h2 { margin: 0 0 12px; font-size: 18px; }
.action-sheet label { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.action-sheet input, .action-sheet textarea {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.action-sheet textarea { min-height: 90px; }
.action-sheet div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.action-sheet div button { height: 36px; padding: 0 14px; border-radius: 18px; }
.action-sheet div button[type="submit"] { background: var(--blue); color: #fff; }
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(76px + var(--safe));
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.empty { padding: 24px 16px; color: var(--muted); }
