.workspace {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  height: calc(100dvh - 64px);
  max-height: calc(100dvh - 64px);
  max-width: 1400px;
  margin: auto;
  background: var(--surface);
  overflow: hidden;
}
.sidebar {
  border-right: 1px solid var(--line);
}
.mail-content {
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100dvh - 64px);
  max-height: calc(100dvh - 64px);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.list-panel {
  min-width: 0;
}
.reading-panel {
  min-width: 0;
}
.sidebar {
  display: flex;
  flex-direction: column;
  align-self: start;
  padding: 24px 16px;
  background: var(--sidebar-bg);
}
.compose-button {
  width: 100%;
  margin-bottom: 28px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.compose-button:active {
  transform: scale(0.98);
}
.folder-nav {
  display: grid;
  gap: 4px;
}
.folder-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--title);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  transition:
    background 0.14s ease,
    color 0.14s ease,
    border-color 0.14s ease;
}
.folder-button:hover {
  background: var(--card);
  color: var(--blue);
  border-color: transparent;
}
.folder-button.active {
  background: var(--input);
  color: var(--blue);
  font-weight: 650;
  border-color: rgba(41, 119, 245, 0.12);
}
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--blue);
  color: var(--button-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.unread-badge[hidden] {
  opacity: 0;
  transform: scale(0.5);
  display: inline-flex;
}
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(16, 42, 67, 0.12);
  max-height: 200px;
  overflow-y: auto;
  margin-top: 2px;
  animation: fade-in 0.12s ease;
}
.autocomplete-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  border-radius: 4px;
  margin: 2px 4px;
}
.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--card);
}
.autocomplete-item.active {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--blue);
}
.compose-field .compose-label + .rich-editor {
  margin-top: 0;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 16px;
}
.panel-header h1 {
  margin: 0;
  color: var(--title);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  text-decoration: none;
  border-radius: 50%;
  border: 1px solid transparent;
  transition:
    background 0.14s ease,
    color 0.14s ease,
    border-color 0.14s ease;
}
.icon-button:hover {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
.list-status {
  margin: 0;
  padding: 0 20px 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.message-list,
.draft-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.message-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  color: inherit;
  text-decoration: none;
  transition:
    background 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}
.message-row:focus {
  outline: none;
}
.message-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--blue);
}
.message-row:hover {
  background: var(--card);
}
.message-row.unread {
  background: transparent;
  font-weight: 600;
}
.message-row.active {
  background: oklch(0.93 0.04 255);
  border-color: oklch(0.59 0.19 255 / 0.2);
}
button.star-glyph {
  background: transparent;
  border: none;
  padding: 4px;
  margin: -4px;
  border-radius: 50%;
  line-height: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}
.star-glyph {
  color: var(--blue);
  font-size: 16px;
  cursor: pointer;
  opacity: 0.32;
  transition:
    opacity 0.12s ease,
    transform 0.14s ease,
    color 0.12s ease,
    background 0.14s ease;
  border-radius: 50%;
}
.star-glyph:hover {
  transform: scale(1.08);
  opacity: 1;
  background: var(--card);
}
.star-glyph:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  opacity: 1;
}
.star-glyph[aria-pressed='true'] {
  opacity: 1;
  color: #f59e0b;
}
.star-filled svg {
  fill: currentColor;
}
.row-sender {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--title);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
}
.row-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-size: 13.5px;
}
.row-subject {
  font-weight: 500;
  color: var(--text);
}
.row-snippet {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
}
.row-snippet:not(:empty)::before {
  content: ' – ';
  color: var(--muted);
}
.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.row-attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted);
}
.message-row.unread .row-sender,
.message-row.unread .row-subject {
  font-weight: 700;
}
@media (max-width: 640px) {
  .message-item .message-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 1px;
  }
  .row-sender {
    grid-column: 1;
    grid-row: 1;
  }
  .row-meta {
    grid-column: 2;
    grid-row: 1;
  }
  .row-text {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.thread-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 7px;
  border-radius: 999px;
  background: rgba(41, 119, 245, 0.08);
  border: 1px solid rgba(41, 119, 245, 0.14);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
