:root {
  --paper: #faf9f5;
  --white: #fff;
  --ink: #26372d;
  --muted: #758077;
  --line: #e4e7df;
  --green: #496d59;
  --green-dark: #355341;
  --tint: #edf3eb;
  --gold: #b18f51;
  --error: #a84239;
  --shadow: 0 24px 90px #20362822;
  font-family:
    "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  font-size: 14px;
  background: var(--paper);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  padding: 8px 13px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: var(--tint);
  border-color: #b9cbb8;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
button.primary:hover {
  background: var(--green-dark);
}
button.danger {
  color: var(--error);
}
button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
button.icon-button {
  padding: 5px 9px;
  font-size: 20px;
  background: transparent;
  border-color: transparent;
  line-height: 1.3;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
input,
textarea,
select {
  border: 1px solid #d5ddd2;
  border-radius: 6px;
  background: white;
  padding: 9px 10px;
  color: var(--ink);
  min-width: 0;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #bed0bb;
  outline-offset: 1px;
}
input[type="checkbox"] {
  accent-color: var(--green);
  width: 15px;
  height: 15px;
  padding: 0;
}
label {
  display: block;
}
label input:not([type="checkbox"]),
label select,
label textarea {
  width: 100%;
  margin-top: 6px;
}
p {
  line-height: 1.8;
}
.flex {
  flex: 1;
}
.eyebrow {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1.8px;
  font-weight: 600;
  margin: 0 0 9px;
}
.pill {
  background: var(--tint);
  color: var(--green);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 20px;
}
.notice {
  background: #f5f2e7;
  border: 1px solid #e8dfc2;
  color: #776647;
  padding: 11px 14px;
  border-radius: 7px;
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.8;
}
.error {
  background: #fff1ed;
  border-color: #efd5cd;
  color: var(--error);
}
[hidden] {
  display: none !important;
}
.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1180px;
  margin: auto;
  align-items: center;
  padding: 70px;
}
.login-card {
  width: min(100%, 390px);
  padding: 10px;
}
.login-mark {
  display: block;
  object-fit: contain;
}
.login-card > .eyebrow {
  margin-top: 28px;
  letter-spacing: 0.5px;
}
.login-card h1 {
  font-size: 38px;
  letter-spacing: -1px;
  margin: 10px 0;
  font-weight: 600;
}
.login-card h1 span {
  font-size: 22px;
  font-weight: 400;
  color: var(--muted);
}
.login-lead {
  color: var(--muted);
  margin-bottom: 35px;
}
.login-card label {
  margin: 18px 0;
  font-size: 12px;
}
.login-card input {
  height: 43px;
}
.login-submit {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
  padding: 12px 16px;
}
.login-footer {
  font-size: 9px;
  letter-spacing: 1.7px;
  color: #a0a89c;
  margin-top: 50px;
}
.login-decoration {
  position: relative;
  min-height: 470px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #7a947a;
}
.decoration-ring {
  position: absolute;
  inset: 20px;
  background: radial-gradient(ellipse at 40% 30%, #d4e0cbb0, transparent 65%);
  border: 1px solid #dce5d8;
  border-radius: 50%;
  transform: rotate(-18deg);
}
.login-decoration span {
  position: relative;
  writing-mode: vertical-rl;
  font-size: 56px;
  letter-spacing: 24px;
  font-family: serif;
  font-weight: 300;
}
.login-decoration p {
  position: relative;
  font-size: 11px;
  letter-spacing: 1.4px;
  margin-top: 45px;
  color: #8e9b86;
}
#app-view {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.topbar {
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 25px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #fdfdf9;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  font-size: 21px;
  letter-spacing: -0.3px;
}
.brand small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 5px;
}
.brand > img {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}
.top-tools {
  display: flex;
  gap: 8px;
  margin-left: 45px;
}
.top-tools button {
  font-size: 12px;
}
.user-tools {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
}
.user-tools button {
  font-size: 11px;
}
.account-switcher {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
  min-height: 48px;
  padding: 7px 19px 0;
  background: #f1f3ed;
  border-bottom: 1px solid var(--line);
}
.account-tabs {
  display: flex;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.account-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  min-width: 100px;
  max-width: 260px;
  margin: 0;
  padding: 9px 17px 8px;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: #697367;
  font-size: 13px;
  font-weight: 600;
}
.account-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-tab[aria-selected="true"] {
  background: var(--white);
  border-color: var(--line);
  border-bottom-color: var(--green);
  color: var(--ink);
}
.account-tab:hover {
  background: var(--tint);
}
.account-tab:focus-visible {
  outline-offset: -3px;
}
.account-switcher > .icon-button {
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 5px;
}
.account-tabs-empty {
  align-self: center;
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}
.account-panel {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.workspace {
  --sidebar-default: 220px;
  --mailbox-default: 370px;
  --sidebar-min: 160px;
  --mailbox-min: 260px;
  --preview-min: 300px;
  --pane-handle: 6px;
  --sidebar-width: var(--sidebar-default);
  --mailbox-width: var(--mailbox-default);
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns:
    var(--sidebar-width) var(--pane-handle)
    var(--mailbox-width) var(--pane-handle) minmax(var(--preview-min), 1fr);
}
.pane-resizer {
  position: relative;
  background: #f7f8f4;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  z-index: 4;
}
.pane-resizer::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 2px;
  width: 1px;
  background: var(--line);
}
.pane-resizer::after {
  content: "";
  position: absolute;
  top: calc(50% - 18px);
  left: 1px;
  width: 4px;
  height: 36px;
  border-radius: 3px;
  background: #acbda6;
}
.pane-resizer:hover,
.pane-resizer:focus-visible,
.pane-resizer.dragging {
  background: #dce8d6;
}
.pane-resizer:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
.pane-resizer:hover::after,
.pane-resizer:focus-visible::after,
.pane-resizer.dragging::after {
  background: var(--green);
}
body.pane-resizing,
body.pane-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}
body.pane-resizing iframe {
  pointer-events: none;
}
.sidebar {
  background: #f3f5ee;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 27px 14px 15px;
}
.sidebar-top {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px 13px;
}
.sidebar-top p {
  margin: 0;
}
.sidebar-top button {
  font-size: 17px;
}
#account-tree {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.folder-row {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-left: calc(var(--folder-depth) * 12px);
}
.tree-toggle,
.tree-spacer,
.tree-arrow {
  flex: 0 0 24px;
  width: 24px;
  text-align: center;
}
.tree-toggle {
  height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #7a9175;
}
.tree-arrow {
  display: inline-block;
  font-size: 13px;
}
.tree-toggle .tree-arrow {
  width: auto;
}
.folder-row .folder {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 7px 6px;
  gap: 6px;
}
.folder {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  margin: 2px 0;
  color: #697367;
  font-size: 12px;
}
.folder.active {
  background: #e3ebdd;
  color: var(--green-dark);
  font-weight: 600;
}
.folder-icon {
  font-size: 16px;
  min-width: 20px;
  color: #7a9175;
}
.folder-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-count {
  flex-shrink: 0;
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #dce7d6;
  color: #36573f;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.inbox-count.stale {
  background: #f6e6ce;
  color: #7b552a;
}
.sidebar-bottom {
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid #e0e6d9;
  padding-top: 12px;
}
.sidebar-tools > button {
  width: 100%;
  display: flex;
  gap: 12px;
  text-align: left;
  border: 0;
  background: none;
  font-size: 12px;
  padding: 11px 12px;
  color: #657460;
}
.sidebar-tools > button:hover {
  background: var(--tint);
}
.count {
  margin-left: auto;
  font-size: 11px;
}
.sidebar-caption {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: #94a08e;
  margin: 28px 7px 5px;
}
.sidebar-caption > img {
  flex-shrink: 0;
  object-fit: contain;
}
.mailbox {
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.mailbox-header {
  padding: 20px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mailbox-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
}
.mailbox-account {
  max-width: 48%;
  font-size: 16px;
  font-weight: 600;
}
.mailbox-title-separator {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 14px;
}
.mailbox-account,
#folder-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mailbox-header > div {
  min-width: 0;
}
.mailbox-header > button {
  flex-shrink: 0;
}
.mailbox-folder-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px; flex-shrink: 0; max-width: 46%; }
.mailbox-folder-actions #empty-trash-button { font-size: 10px; padding: 7px 9px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  margin: 0 20px 18px;
  background: #f5f6f2;
  border-radius: 7px;
  color: #8b9588;
}
.search-box > span {
  font-size: 23px;
}
.search-box input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 11px 0;
  outline: 0;
  font-size: 11px;
}
.search-box button {
  font-size: 10px;
  padding: 6px;
}
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 23px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.list-toolbar > label {
  display: flex;
}
.unread-toggle {
  align-items: center;
  gap: 6px;
  font-size: 10px;
}
.selection-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 8px;
  background: var(--tint);
  font-size: 10px;
}
.selection-toolbar button {
  padding: 5px;
  font-size: 10px;
}
.message-list {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.message-row {
  display: flex;
  gap: 11px;
  padding: 10px 19px;
  border-bottom: 1px solid #edf0e8;
  cursor: pointer;
  position: relative;
  min-height: 73px;
}
.message-row:hover {
  background: #f8faf5;
}
.message-row.selected {
  background: #edf3e7;
  box-shadow: inset 3px 0 #75986c;
}
.message-row.mail-dragging { opacity: .5; }
.folder-row.mail-drop-target { background: #dcebd6; border-radius: 6px; outline: 2px solid #628259; outline-offset: -2px; }
.folder-row.mail-drop-copy { background: #e0edf5; outline-color: #507f9e; }
.mail-drop-invalid { cursor: no-drop; }
.mail-drag-image { position: fixed; top: -100px; left: 0; padding: 10px 16px; border-radius: 8px; background: #36573f; color: #fff; font: 600 13px sans-serif; pointer-events: none; }
#mail-drag-status { position: fixed; bottom: 42px; left: 50%; transform: translateX(-50%); z-index: 40; max-width: min(620px, 90vw); padding: 12px 18px; border: 1px solid #b5c5ac; border-radius: 8px; background: #f3f8ee; color: #36573f; box-shadow: 0 4px 20px #26392126; font-size: 12px; overflow-wrap: anywhere; pointer-events: none; }
.mail-drag-help { display: none; flex-shrink: 0; margin: 0; padding: 6px 14px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.mail-transfer-details { white-space: pre-wrap; overflow-wrap: anywhere; }
.passkey-settings { display: grid; gap: 14px; }
.passkey-settings > label { display: grid; gap: 6px; }
.passkey-settings .card > div { min-width: 0; overflow-wrap: anywhere; }
.passkey-settings .card > button { flex-shrink: 0; white-space: nowrap; }
.passkey-origin { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
#passkey-login-button { width: 100%; padding: 13px 16px; margin-top: 4px; }
#passkey-login-hint { margin: 10px 0 16px; }
@media (hover: hover) and (pointer: fine) {
  .message-row[draggable="true"] { cursor: grab; }
  .message-row input { cursor: pointer; }
  .mail-drag-help { display: block; }
}
.message-row input {
  margin: 3px 0;
  flex-shrink: 0;
}
.row-main {
  flex: 1;
  min-width: 0;
}
.row-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
.row-from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-date {
  font-size: 10px;
  white-space: nowrap;
  color: #90988d;
}
.row-subject {
  font-size: 13px;
  font-weight: 400;
  margin: 4px 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-row.unread .row-subject {
  font-weight: 600;
}
.message-row.unread .row-from {
  color: var(--green-dark);
  font-weight: 600;
}
.unread-dot {
  width: 6px;
  height: 6px;
  background: #76976a;
  border-radius: 50%;
  position: absolute;
  left: 6px;
  top: 17px;
}
.row-meta {
  font-size: 10px;
  color: #98a091;
}
.row-star {
  color: var(--gold);
  margin-left: 8px;
}
.empty-list {
  text-align: center;
  color: var(--muted);
  padding: 55px 25px;
  font-size: 12px;
  line-height: 2;
}
.empty-list button {
  margin-top: 18px;
}
.pager {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 10px;
}
.pager button {
  font-size: 11px;
}
.preview {
  overflow: auto;
  background: #fdfdfa;
  min-width: 0;
}
.preview-empty {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 35px;
  color: #8e9a8a;
}
.empty-mark {
  object-fit: contain;
  margin-bottom: 20px;
}
.preview-empty h2 {
  font-size: 15px;
  font-weight: 500;
  color: #71806b;
}
.preview-empty p {
  font-size: 11px;
  margin-top: 4px;
}
.detail-header {
  padding: 30px 34px 0;
}
.detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.detail-top .eyebrow {
  margin: 0;
}
.detail-header h2 {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.6;
  margin: 15px 0 25px;
  overflow-wrap: anywhere;
}
.sender-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #e9eee2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f9274;
  font-size: 14px;
  flex-shrink: 0;
}
.sender-info {
  flex: 1;
  min-width: 0;
}
.sender-info strong {
  font-size: 11px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.sender-info p {
  font-size: 10px;
  color: #969e90;
  margin: 5px 0;
  overflow-wrap: anywhere;
}
.sender-row time {
  color: #a0a694;
  font-size: 10px;
  white-space: nowrap;
}
.message-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 22px 0 17px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.message-actions button {
  font-size: 10px;
  padding: 6px 9px;
}
.attachment-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.attachment-chip {
  font-size: 11px;
  border: 1px solid #e0e7d8;
  background: #f5f7ef;
  border-radius: 6px;
  padding: 8px 10px;
  color: #66785c;
  cursor: pointer;
}
.attachment-chip small {
  color: #9aa58f;
  margin-left: 7px;
}
.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 13px;
  line-height: 2.2;
  margin: 28px 34px 40px;
  color: #4c5749;
}
.preview .notice {
  margin: 15px 34px;
}
#message-html {
  display: block;
  width: calc(100% - 68px);
  height: 65vh;
  border: 0;
  background: white;
  margin: 25px 34px;
}
.html-notice {
  margin: 20px 34px;
  color: var(--muted);
  font-size: 10px;
}
.statusbar {
  height: 31px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 0 20px;
  color: #8d9787;
  font-size: 10px;
  background: #f8f9f3;
}
.status-dot {
  width: 5px;
  height: 5px;
  background: #95ad87;
  border-radius: 50%;
}
.statusbar > span:last-child {
  font-size: 9px;
  letter-spacing: 0.5px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 16px 23px;
}
.modal-header h2 {
  font-size: 17px;
  font-weight: 500;
  margin: 0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  width: min(780px, calc(100vw - 35px));
  padding: 0;
  box-shadow: var(--shadow);
  max-height: 90vh;
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop {
  background: #20362645;
  backdrop-filter: blur(3px);
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
.modal-header {
  flex-shrink: 0;
}
#modal-body {
  padding: 24px;
  overflow: auto;
  max-height: calc(90vh - 140px);
  min-height: 0;
}
#modal-actions {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 23px;
  border-top: 1px solid var(--line);
  background: #fcfdf8;
}
#modal-actions:empty {
  display: none;
}
.modal-error {
  flex-shrink: 0;
  margin: 0 24px 18px;
  padding: 12px 14px;
  border: 1px solid #efd5cd;
  border-radius: 7px;
  max-height: min(180px, 28vh);
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
}
.transfer-form select {
  width: 100%;
}
.discard-confirmation {
  width: min(440px, calc(100vw - 35px));
  padding: 24px;
  gap: 18px;
}
.discard-confirmation h2 {
  margin: 0;
  font-size: 18px;
}
.discard-confirmation p {
  margin: 0;
}
.discard-confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.form-grid label {
  min-width: 0;
  font-size: 12px;
  color: #677460;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.form-grid h3 {
  grid-column: 1/-1;
  font-size: 12px;
  font-weight: 600;
  margin: 9px 0 -2px;
  color: var(--green);
}
.form-grid textarea {
  min-height: 90px;
  resize: vertical;
}
.form-grid .check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.folder-picker-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.folder-picker-toolbar button {
  flex-shrink: 0;
  font-size: 12px;
}
.folder-picker-status {
  flex: 1;
  min-width: 160px;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.folder-picker-status.error {
  padding: 8px 10px;
}
.folder-visibility h3 { margin: 0; }
.folder-visibility-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.folder-visibility-tools button { font-size: 11px; padding: 6px 10px; }
.folder-visibility-list { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 8px; }
.form-grid .folder-visibility-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px 8px calc(10px + var(--folder-depth) * 14px); margin: 0; border-bottom: 1px solid var(--line); }
.folder-visibility-row:last-child { border-bottom: 0; }
.folder-visibility-row input { flex-shrink: 0; }
.folder-visibility-row span { min-width: 0; overflow-wrap: anywhere; }
.folder-visibility-row.inherited-hidden { color: var(--muted); }
.form-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 15px;
}
.cards {
  display: grid;
  gap: 11px;
}
.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  gap: 12px;
}
.card strong {
  font-size: 13px;
  font-weight: 500;
}
.card p {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.card button {
  font-size: 11px;
}
.card-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.compose-fields {
  display: grid;
  gap: 9px;
}
.reply-format-settings {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.reply-format-settings label {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.reply-format-settings textarea {
  width: 100%;
  min-height: 150px;
  font: inherit;
  font-size: 12px;
  line-height: 1.7;
  resize: vertical;
}
.format-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.format-tokens button {
  font-size: 11px;
  padding: 5px 8px;
}
.format-error {
  color: var(--error);
  white-space: pre-wrap;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.format-error:empty {
  display: none;
}
.compose-fields label {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  gap: 9px;
}
.compose-fields label input,
.compose-fields label select {
  margin: 0;
}
.compose-fields textarea {
  width: 100%;
  min-height: 260px;
  margin-top: 15px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.9;
}
.compose-attachments {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.compose-attachment {
  display: flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  background: white;
  font-size: 11px;
}
.compose-attachment button {
  font-size: 12px;
  padding: 2px 4px;
  border: 0;
}
.review-table {
  display: grid;
  grid-template-columns: 65px 1fr;
  gap: 12px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.review-table dt {
  color: var(--muted);
}
.review-table dd {
  margin: 0;
}
.review-subject {
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 25px;
}
.review-text {
  white-space: pre-wrap;
  font-family: inherit;
  padding: 16px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  line-height: 1.9;
  max-height: 250px;
  overflow: auto;
}
.history-status {
  font-size: 10px;
  color: var(--green);
  background: var(--tint);
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: 9px;
}
.history-status.uncertain,
.history-status.failed {
  color: var(--error);
  background: #fff1ed;
}
.source-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 11px/1.8 monospace;
}
.search-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}
.search-controls input {
  flex: 1;
}
.search-progress {
  font-size: 11px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: #334937;
  color: white;
  padding: 12px 20px;
  border-radius: 9px;
  box-shadow: 0 7px 25px #20362630;
  z-index: 999;
  max-width: min(650px, 90vw);
  font-size: 12px;
  white-space: pre-line;
}
.mobile-only {
  display: none;
}
.busy {
  cursor: progress;
}
.skeleton {
  height: 73px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(100deg, #fafbf7, #eff3e9, #fafbf7);
  background-size: 200% 100%;
  animation: pulse 1.3s ease infinite;
}
@keyframes pulse {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-height: 600px) {
  .sidebar-caption {
    display: none;
  }
}
@media (min-width: 1600px) {
  .workspace {
    --sidebar-default: 240px;
    --mailbox-default: 430px;
  }
  .topbar {
    padding: 0 30px;
  }
  .message-row {
    padding: 10px 23px;
  }
  .detail-header {
    padding: 40px 50px 0;
  }
  .message-text {
    margin: 30px 50px;
  }
}
@media (max-width: 1150px) {
  .workspace {
    --sidebar-default: 190px;
    --mailbox-default: 320px;
    --preview-min: 250px;
  }
  .top-tools {
    margin-left: 15px;
  }
  .detail-header {
    padding: 25px 23px 0;
  }
  .message-text {
    margin: 23px;
  }
  .sender-row time {
    display: none;
  }
  .user-tools span {
    display: none;
  }
  .brand small {
    display: none;
  }
  .topbar {
    padding: 0 15px;
  }
}
@media (max-width: 820px) {
  .workspace {
    --sidebar-default: 170px;
    --mailbox-min: 230px;
    grid-template-columns:
      var(--sidebar-width) var(--pane-handle) minmax(var(--mailbox-min), 1fr);
  }
  #mailbox-resizer {
    display: none;
  }
  .preview {
    position: absolute;
    inset: 0 0 0 calc(var(--sidebar-width) + var(--pane-handle));
    z-index: 3;
  }
  .preview:has(#message-detail[hidden]) {
    display: none;
  }
  .mobile-only {
    display: inline-block;
  }
  #back-to-list {
    margin: 15px 14px 0;
  }
  .top-tools {
    gap: 5px;
    margin-left: auto;
  }
  .top-tools button {
    padding: 7px;
    font-size: 11px;
  }
  .user-tools {
    margin-left: 0;
  }
  .topbar {
    gap: 9px;
  }
  .brand {
    font-size: 18px;
  }
}
@media (max-width: 560px) {
  .account-switcher {
    padding: 6px 9px 0;
    gap: 4px;
  }
  .account-tab {
    min-width: 90px;
    max-width: 210px;
    padding: 9px 12px 8px;
    gap: 6px;
  }
  .account-tabs-empty {
    min-width: 0;
    font-size: 11px;
  }
  .login-view {
    display: block;
    padding: 50px 25px;
  }
  .login-card {
    margin: auto;
  }
  .login-decoration {
    display: none;
  }
  .topbar {
    height: 59px;
    padding: 0 9px;
  }
  .topbar .brand {
    font-size: 16px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .top-tools #contacts-button,
  .top-tools #settings-button {
    display: none;
  }
  .user-tools #logout-button {
    font-size: 0;
    padding: 5px;
  }
  .user-tools #logout-button:after {
    content: "終了";
    font-size: 10px;
  }
  .workspace {
    display: block;
  }
  .pane-resizer {
    display: none;
  }
  .sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 220px;
    z-index: 5;
    box-shadow: 10px 0 30px #23392820;
    display: none;
  }
  .sidebar.open {
    display: flex;
  }
  .mailbox {
    height: 100%;
  }
  .preview {
    inset: 0;
  }
  .top-tools {
    gap: 4px;
  }
  .mailbox-header {
    padding: 18px 18px 12px;
  }
  .message-row {
    padding: 9px 19px;
    min-height: 70px;
  }
  .skeleton {
    height: 70px;
  }
  .statusbar {
    padding: 0 11px;
  }
  .statusbar > span:last-child {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  .card {
    align-items: flex-start;
  }
  .card-actions {
    flex-direction: column;
  }
  #modal-body {
    padding: 18px;
  }
  .compose-fields textarea {
    min-height: 220px;
  }
  .message-actions {
    gap: 4px;
  }
  .detail-header h2 {
    font-size: 20px;
  }
  .review-table {
    grid-template-columns: 55px 1fr;
  }
}
.labels-section { display:flex; flex-direction:column; padding: 8px 16px; flex-shrink: 0; max-height: 28vh; overflow: hidden; border-top: 1px solid var(--line); }
.labels-section .sidebar-top { padding: 0; }
.labels-section #label-list { min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.sidebar-section-toggle { display:flex; align-items:center; gap:6px; padding:7px 0; border:0; background:transparent; text-align:left; }
.sidebar-section-toggle:hover { background:var(--tint); }
.sidebar-section-toggle .eyebrow { margin:0; }
.sidebar-section-arrow { width:12px; flex-shrink:0; font-size:12px; line-height:1; color:#7a9175; }
.labels-section .sidebar-section-toggle { flex:1; min-width:0; }
.sidebar-bottom > .sidebar-section-toggle { width:100%; padding:7px 12px; }
.label-nav { display:flex; align-items:center; gap:8px; width:100%; text-align:left; border:0; background:transparent; padding:6px; font-size:12px; }
.label-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.label-filter { display:flex; align-items:center; gap:8px; margin:0; padding:0 18px 8px; font-size:11px; flex-shrink:0; }
.label-filter select { flex:1; min-width:0; max-width:100%; padding:5px 8px; font-size:11px; }
.label-chip { display:inline-block; border:1px solid; border-radius:4px; padding:1px 5px; margin:2px 3px; font-size:10px; color:var(--ink); background:var(--white); overflow-wrap:anywhere; }
.label-editor { display:flex; flex-wrap:wrap; align-items:end; gap:8px; padding-bottom:12px; border-bottom:1px solid var(--line); }
.label-editor label:first-child { flex:1; min-width:150px; }
.label-editor input[type=color] { width:56px; height:38px; padding:3px; }
.stored-message { display:flex; flex-wrap:wrap; text-align:left; gap:5px; width:100%; padding:12px; }
.stored-message strong,.stored-message>span:not(.label-chip) { width:100%; overflow-wrap:anywhere; }
.stored-message>span:not(.label-chip) { font-size:11px; color:var(--muted); }
.stored-body { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; font-size:13px; }
.stored-html { border:1px solid var(--line); width:100%; height:400px; background:white; }
.cards progress { width:100%; }
.cards input[type=checkbox] { width:auto; margin-right:8px; }
.sidebar-tools > .mobile-settings { display:none; }
@media (max-width:560px) {
 .sidebar-tools > .mobile-settings { display:flex; }
 .sidebar-caption { margin-top:8px; }
}
