:root {
  color-scheme: light;
  --bg: #f4f2ee;
  --ink: #151515;
  --muted: #77736d;
  --line: #ded9d1;
  --panel: #fffdf8;
  --soft-panel: #f8f5ee;
  --dark: #171717;
  --accent: #d64b2a;
  --danger: #b82f21;
  --warn: #9a7131;
  --ok: #5f6f3c;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter,
    "Noto Sans JP",
    "Noto Sans CJK JP",
    "Hiragino Sans",
    "Yu Gothic",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.login-page {
  display: grid;
  min-height: 100vh;
  color: #1b2533;
  background: #f5f7fb;
}

.login-page[data-login-step="accounts"] {
  color: #e8eaed;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05), transparent 34%),
    #202124;
}

.login-shell {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 48px 24px;
}

.login-card-simple {
  display: grid;
  justify-items: center;
  width: min(440px, 100%);
  padding: 44px 48px;
  border: 1px solid #e4e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(26, 32, 44, 0.14);
}

.login-brand {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  font-size: 22px;
  font-weight: 600;
}

.login-card-simple h1 {
  margin: 0 0 8px;
  color: #1b2533;
  font-size: 23px;
  line-height: 1.25;
  text-align: center;
}

.login-card-simple p {
  margin: 0 0 28px;
  color: #8b97a8;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.google-signin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(280px, 100%);
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #dfe4ea;
  border-radius: 999px;
  color: #334155;
  background: #fff;
  box-shadow: 0 1px 2px rgba(26, 32, 44, 0.08);
  font-weight: 600;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.google-signin-button:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(26, 32, 44, 0.12);
  transform: translateY(-1px);
}

.login-card {
  display: grid;
  width: min(760px, 100%);
  overflow: hidden;
  border: 1px solid #3c4043;
  border-radius: 14px;
  background: #0f0f0f;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

.login-card-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid #2f3033;
  color: #e8eaed;
  font-size: 13px;
  font-weight: 500;
}

.google-brand-mark {
  color: #4285f4;
  font-size: 18px;
  font-weight: 600;
}

.login-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 48px;
  padding: 42px 26px 44px;
}

.login-intro {
  display: grid;
  align-content: start;
  min-width: 0;
  padding-right: 12px;
}

.login-card h1 {
  margin: 0 0 24px;
  color: #f1f3f4;
  font-size: 33px;
  font-weight: 400;
  line-height: 1.18;
  text-align: left;
}

.login-card p {
  margin: 0;
  color: #e8eaed;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
}

.login-card p strong {
  color: #8ab4f8;
  font-weight: 600;
  word-break: break-word;
}

.account-choice-list {
  display: grid;
  align-content: start;
  min-width: 0;
}

.account-choice {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 10px;
  border-bottom: 1px solid #3c4043;
  color: #e8eaed;
  background: #0f0f0f;
  text-align: left;
  transition: background 140ms ease;
}

.account-choice:first-child {
  border-top: 1px solid #3c4043;
}

.account-choice:hover,
.account-choice:focus-visible {
  background: #252628;
}

.account-choice:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 3px;
}

.google-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: #df7a25;
  font-size: 12px;
  font-weight: 600;
}

.google-avatar-alt {
  background: #5f6368;
}

.google-login-text {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.google-login-text strong,
.google-login-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.google-login-text strong {
  color: #f1f3f4;
  font-size: 13px;
  font-weight: 500;
}

.google-login-text small {
  color: #bdc1c6;
  font-size: 11px;
  font-weight: 500;
}

.use-other {
  grid-template-columns: 40px minmax(0, 1fr);
  border-radius: 0 0 10px 10px;
  background: #1f2023;
  color: #e8eaed;
  font-size: 13px;
  font-weight: 500;
}

.other-account-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #5f6368;
  border-radius: 50%;
  color: #bdc1c6;
  font-size: 16px;
  font-weight: 500;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(760px, 100%);
  margin-top: 18px;
  padding: 0 12px;
  color: #bdc1c6;
  font-size: 12px;
}

.login-footer nav {
  display: flex;
  gap: 28px;
}

.login-footer a:hover {
  color: #f1f3f4;
}

.selected-account {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: min(280px, 100%);
  min-height: 48px;
  margin-bottom: 24px;
  padding: 6px 10px;
  border: 1px solid #dfe4ea;
  border-radius: 999px;
  background: #fff;
}

.selected-account .google-login-text strong {
  color: #334155;
  font-size: 12px;
}

.selected-account .google-login-text small {
  color: #8995a5;
  font-size: 10px;
  font-weight: 500;
}

.login-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #e3e7ee;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loginSpin 900ms linear infinite;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.app-shell {
  min-height: 100vh;
}

.global-header {
  position: sticky;
  top: 0;
  z-index: 15;
  color: #fff;
  background: var(--dark);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.global-header-inner {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 0 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: var(--accent);
  font-weight: 600;
}

.account-summary {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 260px;
  min-height: 44px;
  padding: 6px 12px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: #df7a25;
  font-size: 15px;
  font-weight: 600;
}

.account-text {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.account-text strong,
.account-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-text strong {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.account-text small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.eyebrow {
  margin: 0;
  color: #b8b0a6;
  font-size: 12px;
  font-weight: 500;
}

.workspace {
  padding: 24px;
}

.module-switch {
  justify-self: center;
  display: inline-flex;
  gap: 4px;
  margin-bottom: 0;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.module-switch button,
.module-switch a {
  display: inline-grid;
  place-items: center;
  min-width: 136px;
  height: 42px;
  padding: 0 18px;
  color: #d8d0c7;
  border-radius: 6px;
  background: transparent;
  font-weight: 600;
}

.module-switch button.active,
.module-switch a.active {
  color: var(--dark);
  background: #fffdf8;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 34px;
  line-height: 1.1;
}

.lead {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.analyze-button,
.reset-button {
  min-width: 118px;
  height: 42px;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-weight: 600;
}

.analyze-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 32;
  width: 112px;
  min-width: 112px;
  height: 112px;
  border-radius: 50%;
  font-size: 16px;
  box-shadow: 0 18px 42px rgba(214, 75, 42, 0.28);
}

.analyze-button.is-my-task {
  width: 132px;
  min-width: 132px;
  height: 58px;
  border-radius: 12px;
  background: #2563eb;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.28);
}

.analyze-button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.reset-button {
  background: var(--dark);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.view-head,
.result-banner,
.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.view-head {
  margin-bottom: 12px;
}

.view-head h2,
.result-banner h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.view-head span,
.column-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.message-list {
  display: grid;
  gap: 8px;
}

.message-card,
.sorted-card,
.analysis-card,
.result-banner,
.sort-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.message-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 16px;
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    box-shadow 140ms ease;
  cursor: pointer;
}

.message-card.is-entering {
  opacity: 0;
  transform: translateY(14px);
}

.message-card:hover,
.message-card:focus-visible,
.sorted-card:hover,
.sorted-card:focus-visible {
  outline: 2px solid rgba(214, 75, 42, 0.34);
  outline-offset: 2px;
  box-shadow: 0 10px 24px rgba(34, 28, 22, 0.08);
  transform: translateY(-1px);
}

.message-card.is-scanning {
  animation: scanPulse 720ms ease-in-out infinite;
}

.sender-initial {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  background: var(--dark);
  font-weight: 600;
}

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

.message-head strong {
  font-size: 15px;
}

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

.message-card h3 {
  margin: 0 0 5px;
  font-size: 18px;
  line-height: 1.35;
}

.message-card p,
.sorted-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.analysis-view {
  min-height: 420px;
}

.analysis-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(560px, 100%);
  margin: 80px auto 0;
  padding: 32px;
  text-align: center;
  box-shadow: 0 18px 46px rgba(34, 28, 22, 0.1);
}

.scanner {
  position: relative;
  overflow: hidden;
  width: 180px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, #fffdf8 0 18px, #f3eee5 18px 19px),
    var(--panel);
}

.scanner span {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(214, 75, 42, 0.22), transparent);
  animation: scanLine 1.1s linear infinite;
}

.scanner::before,
.scanner::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  height: 10px;
  border-radius: 999px;
  background: rgba(21, 21, 21, 0.16);
}

.scanner::before {
  top: 32px;
  box-shadow:
    0 22px 0 rgba(21, 21, 21, 0.12),
    0 44px 0 rgba(21, 21, 21, 0.1);
}

.scanner::after {
  top: 10px;
  width: 62px;
  background: var(--accent);
}

.analysis-card h2 {
  margin-bottom: 0;
}

.analysis-status {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.progress-bar {
  overflow: hidden;
  width: min(360px, 100%);
  height: 8px;
  border-radius: 999px;
  background: var(--soft-panel);
}

.progress-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ef8a3a);
  animation: progressLoop 1.6s ease-in-out infinite;
}

.analysis-steps {
  display: grid;
  gap: 8px;
  width: min(360px, 100%);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.analysis-steps li {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--soft-panel);
}

.result-banner {
  margin-bottom: 14px;
  padding: 16px;
}

.sort-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sort-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 420px;
  padding: 14px;
}

.column-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.column-head h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.sort-column.risk {
  background: #fff8f4;
}

.sort-column.check {
  background: #fffaf0;
}

.sort-column.normal {
  background: #f9faf2;
}

.sorted-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  animation: cardDrop 360ms ease both;
  cursor: pointer;
}

.sorted-card.is-sent {
  border-color: rgba(22, 163, 74, 0.34);
  background: #f7fbf6;
}

.sorted-card strong {
  font-size: 15px;
}

.sent-label {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #166534;
  background: #dcfce7;
  font-size: 12px;
  font-weight: 600;
}

.chip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: #5f5952;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-panel);
  font-size: 12px;
  font-weight: 600;
}

.chip.danger {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.chip.warn {
  color: #fff;
  border-color: var(--warn);
  background: var(--warn);
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  display: grid;
  align-content: start;
  gap: 18px;
  width: min(520px, calc(100% - 40px));
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -22px 0 48px rgba(34, 28, 22, 0.14);
  transform: translateX(104%);
  transition: transform 220ms ease;
  -webkit-overflow-scrolling: touch;
}

.detail-panel.is-open {
  transform: translateX(0);
}

.detail-panel.is-refreshing .detail-header,
.detail-panel.is-refreshing .detail-meta,
.detail-panel.is-refreshing .detail-section:not([hidden]) {
  animation: detailRefreshSlide 260ms ease both;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-header h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.35;
}

.detail-close {
  min-width: 72px;
  height: 36px;
  border-radius: 6px;
  color: #fff;
  background: var(--dark);
  font-weight: 600;
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}

.detail-meta div,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
}

.detail-meta div {
  padding: 10px;
}

.detail-meta .detail-analysis-meta {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.06);
}

.detail-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.detail-meta dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-section {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.detail-section[hidden] {
  display: none;
}

.detail-section h3,
.detail-section p {
  margin-bottom: 0;
}

.detail-section h3 {
  font-size: 15px;
}

.detail-section p {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.my-task-modal {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: none;
  place-items: center;
  padding: 24px;
}

.my-task-modal.is-open {
  display: grid;
}

.my-task-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.46);
  backdrop-filter: blur(4px);
}

.my-task-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(620px, 100%);
  max-height: min(620px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(34, 28, 22, 0.24);
  animation: myTaskModalIn 180ms ease both;
}

.my-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #f4f7f5;
}

.my-task-head h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.my-task-head p:last-child {
  margin-bottom: 0;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}

.my-task-close {
  min-width: 72px;
  height: 36px;
  border-radius: 6px;
  color: #fff;
  background: var(--dark);
  font-weight: 600;
}

.my-task-list {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding: 18px 20px 20px;
}

.my-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
  text-align: left;
}

.my-task-item:hover,
.my-task-item:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.32);
  outline-offset: 2px;
  box-shadow: 0 10px 24px rgba(34, 28, 22, 0.08);
}

.my-task-item span {
  display: grid;
  gap: 5px;
}

.my-task-item strong {
  font-size: 16px;
}

.my-task-item small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.my-task-tags {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.my-task-item.is-sent {
  border-color: rgba(22, 163, 74, 0.34);
  background: #f7fbf6;
}

.my-task-item em {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: #2563eb;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  text-align: center;
}

.my-task-empty {
  margin-bottom: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft-panel);
  font-weight: 600;
}

.mail-send-modal {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: none;
  place-items: center;
  padding: 24px;
}

.mail-send-modal.is-open {
  display: grid;
}

.mail-send-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.5);
  backdrop-filter: blur(4px);
}

.mail-send-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(680px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(34, 28, 22, 0.24);
  animation: myTaskModalIn 180ms ease both;
}

.mail-send-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #f4f7f5;
}

.mail-send-head h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.mail-send-head p:last-child {
  margin-bottom: 0;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}

.mail-send-close,
.mail-send-secondary,
.mail-send-primary {
  min-width: 86px;
  height: 36px;
  border-radius: 6px;
  font-weight: 600;
}

.mail-send-close,
.mail-send-primary {
  color: #fff;
  background: var(--dark);
}

.mail-send-body {
  display: grid;
  gap: 14px;
  overflow-y: auto;
  padding: 18px 20px 20px;
}

.mail-send-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mail-send-meta div,
.mail-send-draft {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
}

.mail-send-meta div {
  padding: 10px;
}

.mail-send-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.mail-send-meta dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.mail-send-draft {
  display: grid;
  gap: 8px;
  min-height: 160px;
  padding: 14px;
}

.mail-send-draft h3,
.mail-send-draft p {
  margin-bottom: 0;
}

.mail-send-draft h3 {
  font-size: 15px;
}

.mail-send-draft p {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.mail-send-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8f7f3;
  font-size: 14px;
  font-weight: 600;
}

.mail-send-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
}

.mail-send-status.is-sending {
  border-color: rgba(37, 99, 235, 0.24);
  color: #1d4ed8;
  background: #eff6ff;
}

.mail-send-status.is-sending .mail-send-status-dot {
  background: #2563eb;
  animation: sendPulse 760ms ease-in-out infinite;
}

.mail-send-status.is-complete {
  border-color: rgba(22, 163, 74, 0.28);
  color: #166534;
  background: #f0fdf4;
}

.mail-send-status.is-complete .mail-send-status-dot {
  background: #16a34a;
}

.mail-send-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.mail-send-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
}

.mail-send-primary {
  background: #2563eb;
}

.mail-send-primary:disabled {
  opacity: 0.75;
  cursor: default;
}

.customer-workspace {
  background: #f7f6f2;
}

.customer-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.customer-toolbar {
  display: grid;
  grid-template-columns: 180px minmax(260px, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.customer-total {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.customer-total strong {
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
}

.customer-search {
  position: relative;
  display: block;
}

.customer-search span {
  position: absolute;
  top: 50%;
  left: 12px;
  color: #a49b91;
  transform: translateY(-50%);
  font-weight: 600;
}

.customer-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 18px rgba(34, 28, 22, 0.04);
}

.customer-search input {
  padding: 0 14px 0 34px;
}

.customer-search input::placeholder {
  color: #aaa39b;
}

.kana-filter {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.kana-filter button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  font-weight: 600;
}

.kana-filter button.active {
  color: #fff;
  border-color: var(--dark);
  background: var(--dark);
}

.customer-table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(34, 28, 22, 0.07);
}

.customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.customer-table th,
.customer-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #ebe6dc;
  text-align: left;
  vertical-align: middle;
}

.customer-table th {
  color: #8b8379;
  background: #f6f1e9;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.customer-table tbody tr {
  cursor: pointer;
  transition:
    background 140ms ease,
    box-shadow 140ms ease;
}

.customer-table tbody tr:hover,
.customer-table tbody tr:focus-visible {
  outline: none;
  background: #fff9f0;
  box-shadow: inset 3px 0 0 var(--accent);
}

.customer-table td:first-child {
  display: grid;
  gap: 4px;
}

.customer-table td:first-child strong {
  font-size: 15px;
}

.customer-table td:first-child small {
  color: var(--muted);
  font-weight: 500;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.count-badge.active {
  color: var(--accent);
  background: #fff0e9;
}

.count-badge.empty {
  color: #9b5247;
  background: #f7ebe6;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #b9dccb;
  border-radius: 6px;
  color: #267553;
  background: #edf9f2;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.customer-badge.warn {
  color: #9b5247;
  border-color: #edcabd;
  background: #fff0e9;
}

.customer-badge.muted {
  color: #8b8379;
  border-color: var(--line);
  background: var(--soft-panel);
}

.modal-badges {
  padding-top: 2px;
}

.customer-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
}

.customer-modal.is-open {
  display: grid;
}

.customer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.42);
  backdrop-filter: blur(4px);
}

.customer-modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(34, 28, 22, 0.24);
}

.customer-modal-head {
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #f8f5ee;
  text-align: center;
}

.customer-modal-head h2 {
  margin-bottom: 3px;
  font-size: 22px;
}

.customer-modal-head p {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 500;
}

.customer-modal-nav,
.customer-modal-close {
  min-height: 36px;
  border-radius: 6px;
  font-weight: 600;
}

.customer-modal-nav {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
}

.customer-modal-nav:disabled {
  cursor: default;
  opacity: 0.35;
}

.customer-modal-body {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  padding: 20px;
}

.modal-section-label {
  margin-bottom: 8px;
  color: #aaa39b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.65fr 0.85fr;
  gap: 10px;
  margin: 0;
}

.modal-info-grid div,
.modal-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
  padding: 14px;
}

.modal-info-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.modal-info-grid dd,
.modal-note p:last-child {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.7;
}

.modal-note p:last-child {
  font-size: 14px;
}

.customer-modal-close {
  margin: 0 20px 20px;
  color: #fff;
  background: var(--dark);
}

.placeholder-panel {
  display: grid;
  gap: 10px;
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
}

.placeholder-panel h2,
.placeholder-panel p {
  margin-bottom: 0;
}

.placeholder-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.back-link {
  justify-self: start;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 600;
}

/* Proposal PDF tone: keep the interface lighter and closer to Noto/Inter typesetting. */
h1,
.login-card h1,
.login-card-simple h1 {
  font-weight: 500;
}

h2,
h3,
.message-card h3,
.detail-header h2,
.my-task-head h2,
.mail-send-head h2,
.customer-modal-head h2 {
  font-weight: 500;
}

strong,
.message-head strong,
.sorted-card strong,
.my-task-item strong,
.customer-table td:first-child strong,
.detail-meta dd,
.modal-info-grid dd,
.modal-note p:last-child,
.account-text strong,
.google-login-text strong {
  font-weight: 600;
}

.eyebrow,
.lead,
.time,
.view-head span,
.column-head span,
.login-card p,
.login-card-simple p,
.google-login-text small,
.selected-account .google-login-text small,
.account-text small,
.detail-section p,
.my-task-item small,
.customer-table td:first-child small,
.customer-modal-head p {
  font-weight: 400;
}

button,
.module-switch button,
.module-switch a,
.google-signin-button,
.analyze-button,
.reset-button,
.detail-close,
.my-task-close,
.mail-send-close,
.mail-send-secondary,
.mail-send-primary,
.customer-modal-nav,
.customer-modal-close,
.back-link {
  font-weight: 600;
}

.login-brand,
.app-icon,
.brand-mark,
.google-brand-mark,
.google-avatar,
.account-avatar,
.sender-initial,
.other-account-icon {
  font-weight: 600;
}

.chip,
.count-badge,
.customer-badge,
.customer-total,
.customer-total strong,
.customer-search span,
.customer-search input,
.kana-filter button,
.customer-table th,
.modal-section-label,
.detail-meta dt,
.my-task-head p:last-child,
.my-task-item em,
.my-task-empty,
.sent-label,
.mail-send-status {
  font-weight: 500;
}

@keyframes scanPulse {
  0%,
  100% {
    opacity: 1;
    transform: translateX(0);
  }

  50% {
    opacity: 0.62;
    transform: translateX(4px);
  }
}

@keyframes scanLine {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(100%);
  }
}

@keyframes progressLoop {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(260%);
  }
}

@keyframes cardDrop {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes detailRefreshSlide {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes myTaskModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sendPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.62;
  }

  50% {
    transform: scale(1.7);
    opacity: 1;
  }
}

@keyframes loginSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-card {
    transition: none;
  }

  .message-card.is-entering {
    opacity: 1;
    transform: none;
  }

  .detail-panel.is-refreshing .detail-header,
  .detail-panel.is-refreshing .detail-meta,
  .detail-panel.is-refreshing .detail-section:not([hidden]) {
    animation: none;
  }

  .my-task-card {
    animation: none;
  }
}

@media (max-width: 900px) {
  .login-shell {
    align-content: start;
    padding: 26px 14px;
  }

  .login-card-simple {
    padding: 34px 24px;
  }

  .login-card-simple h1 {
    font-size: 21px;
  }

  .login-card-body {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 30px 22px 28px;
  }

  .login-card h1 {
    margin-bottom: 16px;
    font-size: 30px;
  }

  .login-footer {
    flex-direction: column;
    gap: 14px;
    padding: 0 4px;
  }

  .login-footer nav {
    justify-content: space-between;
    gap: 14px;
  }

  .global-header-inner {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 18px;
  }

  .brand-mark {
    justify-self: center;
  }

  .account-summary {
    position: absolute;
    top: 12px;
    right: 18px;
    min-height: 42px;
    padding: 4px;
  }

  .account-avatar {
    width: 34px;
    height: 34px;
  }

  .account-text {
    display: none;
  }

  .module-switch {
    width: 100%;
  }

  .module-switch a {
    flex: 1;
    min-width: 0;
  }

  .workspace {
    padding: 18px;
  }

  .analyze-button {
    right: 18px;
    bottom: 18px;
    width: 108px;
    min-width: 108px;
    height: 108px;
    font-size: 16px;
  }

  .topbar,
  .customer-page-head,
  .result-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .customer-toolbar {
    grid-template-columns: 1fr;
  }

  .customer-table-card {
    overflow-x: auto;
  }

  .customer-table {
    min-width: 860px;
  }

  .customer-modal {
    padding: 14px;
  }

  .customer-modal-card {
    max-height: calc(100vh - 28px);
  }

  .customer-modal-head {
    grid-template-columns: 64px 1fr 64px;
    gap: 8px;
    padding: 14px;
  }

  .customer-modal-head h2 {
    font-size: 19px;
  }

  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  .sort-board {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    width: min(520px, calc(100% - 40px));
  }
}
