/* All styles are local so the application works with a self-only Content Security Policy. */
:root {
  color-scheme: light;
  --paper: #f5f7f6;
  --surface: #ffffff;
  --ink: #172a2c;
  --muted: #718082;
  --line: #e5ecea;
  --teal: #087e8b;
  --teal-dark: #076a75;
  --teal-soft: #e1f3f2;
  --red: #c34343;
  --shadow: 0 18px 60px rgba(22, 56, 55, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 17px; font-weight: 720; letter-spacing: -.045em; text-decoration: none; white-space: nowrap; }
.brand-lockup b { color: var(--teal); font-weight: 720; }
.brand-mark { width: 30px; height: 24px; display: inline-flex; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 4px; border-radius: 8px 8px 5px 5px; background: var(--teal); transform: skewY(-4deg); }
.brand-mark i { display: block; height: 2px; border-radius: 2px; background: white; opacity: .95; }
.brand-mark i:nth-child(2) { width: 78%; }
.brand-mark i:nth-child(3) { width: 55%; }
.eyebrow { margin: 0; color: var(--teal); font-size: 10px; font-weight: 760; letter-spacing: .15em; line-height: 1.5; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 700; transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.button:active { transform: translateY(1px); }
.button:focus-visible, .icon-button:focus-visible, .nav-item:focus-visible, .auth-tab:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(8, 126, 139, .22); outline-offset: 2px; }
.button-primary { color: #fff; background: var(--teal); box-shadow: 0 5px 14px rgba(8, 126, 139, .17); }
.button-primary:hover { background: var(--teal-dark); box-shadow: 0 7px 18px rgba(8, 126, 139, .24); }
.button-primary:disabled { cursor: wait; opacity: .65; }
.button-wide { width: 100%; margin-top: 23px; min-height: 48px; }
.button-quiet { color: var(--teal-dark); background: var(--teal-soft); border-color: #d2eae8; }
.button-quiet:hover { background: #d5eeec; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #647476; font-size: 20px; transition: background .15s ease, color .15s ease; }
.icon-button:hover { color: var(--teal); background: var(--teal-soft); }
.auth-layout { display: grid; grid-template-columns: minmax(320px, .94fr) minmax(420px, 1.06fr); min-height: 100vh; background: var(--surface); }
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 46px clamp(32px, 6vw, 86px); overflow: hidden; color: white; background: #123d42; }
.auth-brand::before, .auth-brand::after { position: absolute; content: ""; border: 1px solid rgba(185, 235, 229, .17); border-radius: 50%; pointer-events: none; }
.auth-brand::before { width: 640px; height: 640px; right: -245px; bottom: -198px; }
.auth-brand::after { width: 470px; height: 470px; right: -160px; bottom: -110px; }
.auth-brand .brand-lockup { position: relative; z-index: 1; color: #fff; }
.auth-brand .brand-lockup b { color: #7ed4cc; }
.auth-brand .brand-mark { background: #48b9b0; }
.auth-message { position: relative; z-index: 1; margin: auto 0; padding: 60px 0 88px; }
.auth-message .eyebrow { color: #8ed9d1; }
.auth-message h1 { margin: 24px 0 16px; font-size: clamp(38px, 5.2vw, 66px); font-weight: 650; letter-spacing: -.075em; line-height: 1.24; }
.auth-message > p:last-child { color: rgba(239, 250, 248, .74); font-size: 15px; line-height: 1.8; }
.auth-footnote { position: relative; z-index: 1; color: rgba(232, 248, 246, .6); font-size: 12px; letter-spacing: .02em; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px 26px 26px; background: #fff; }
.auth-card { width: min(100%, 418px); padding: 16px 0 10px; }
.auth-card h2 { margin: 8px 0 8px; font-size: 30px; font-weight: 680; letter-spacing: -.06em; }
.auth-copy { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.mobile-brand { display: none; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 26px; padding: 4px; border-radius: 12px; background: #f1f5f4; }
.auth-tab { min-height: 38px; border: 0; border-radius: 9px; color: #718082; background: transparent; font-size: 13px; font-weight: 650; }
.auth-tab.is-active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(13, 54, 54, .08); }
.field-label { display: block; margin: 17px 0 8px; color: #425557; font-size: 12px; font-weight: 680; }
.address-input { display: flex; align-items: center; height: 48px; overflow: hidden; border: 1px solid #dce7e5; border-radius: 10px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.address-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 126, 139, .1); }
.address-input input { width: 0; flex: 1; height: 100%; padding: 0 12px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.address-domain { padding: 0 12px 0 3px; color: #728383; font-size: 12px; white-space: nowrap; }
.text-input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid #dce7e5; border-radius: 10px; color: var(--ink); background: #fff; font-size: 14px; }
.text-input::placeholder, input::placeholder, textarea::placeholder { color: #a3b0ae; }
.text-input:focus, textarea:focus, .compose-row input:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 3px rgba(8, 126, 139, .1); }
.field-hint { margin: 7px 0 13px; color: #889594; font-size: 10px; line-height: 1.5; }
.status-message { min-height: 20px; margin: 10px 0 0; color: var(--red); font-size: 12px; line-height: 1.6; }
.status-message.is-success { color: #19775f; }
.privacy-note { margin: 14px 0 0; color: #98a4a2; text-align: center; font-size: 10px; }
.auth-legal { width: min(100%, 440px); margin: 28px 0 0; color: #a0aaa8; text-align: center; font-size: 10px; line-height: 1.6; }
.mail-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: var(--paper); }
.sidebar { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 27px 17px 17px; border-right: 1px solid var(--line); background: #fff; }
.sidebar-brand { padding: 0 8px; }
.button-compose { justify-content: flex-start; min-height: 46px; margin: 38px 2px 26px; padding: 0 15px; color: #fff; background: var(--teal); box-shadow: 0 7px 16px rgba(8, 126, 139, .17); }
.button-compose:hover { background: var(--teal-dark); }
.compose-plus { font-size: 19px; font-weight: 400; }
.mail-nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 0 12px; border: 0; border-radius: 10px; color: #697879; background: transparent; text-align: left; font-size: 12px; font-weight: 580; }
.nav-item:hover { background: #f5f8f7; color: var(--ink); }
.nav-item.is-active { color: var(--teal-dark); background: #e7f4f3; font-weight: 700; }
.nav-icon { width: 18px; color: inherit; font-size: 17px; text-align: center; }
.nav-count { margin-left: auto; color: #738483; font-size: 10px; }
.sidebar-bottom { margin-top: auto; }
.account-card { display: flex; align-items: center; gap: 10px; padding: 12px 6px 14px; border-top: 1px solid var(--line); }
.account-avatar, .sender-avatar { display: inline-grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #176b6d; background: #d9efea; font-size: 12px; font-weight: 750; }
.account-avatar { width: 34px; height: 34px; }
.account-meta { display: grid; min-width: 0; gap: 4px; flex: 1; }
.account-meta strong { overflow: hidden; color: #334748; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.account-meta span { overflow: hidden; color: #8b9796; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.logout-button { width: 30px; height: 30px; font-size: 17px; }
.sidebar-caption { margin: 4px 6px 0; color: #adb7b4; font-size: 9px; }
.sidebar-caption span { padding: 0 4px; color: #61b9b1; }
.workspace { display: flex; min-width: 0; min-height: 100vh; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 66px; padding: 0 29px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.76); }
.breadcrumb { display: inline-flex; align-items: center; gap: 10px; color: #596b6c; font-size: 12px; font-weight: 650; }
.breadcrumb-dot { width: 7px; height: 7px; border-radius: 50%; background: #54b8ad; box-shadow: 0 0 0 4px #e1f4f1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(250px, 26vw); height: 36px; padding: 0 10px; border: 1px solid #e4ecea; border-radius: 9px; color: #93a09e; background: #fff; }
.search-box > span { font-size: 21px; line-height: 1; transform: rotate(-15deg); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.mailbox-layout { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); flex: 1; min-height: 0; }
.list-pane { position: relative; min-width: 0; border-right: 1px solid var(--line); background: #fff; }
.list-heading { display: flex; align-items: end; justify-content: space-between; min-height: 104px; padding: 26px 24px 19px; border-bottom: 1px solid var(--line); }
.list-heading h1 { margin: 6px 0 0; font-size: 24px; font-weight: 690; letter-spacing: -.065em; }
.message-count { padding-bottom: 3px; color: #96a3a1; font-size: 10px; }
.message-list { overflow-y: auto; max-height: calc(100vh - 171px); }
.message-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; width: 100%; padding: 16px 19px 15px 23px; border: 0; border-bottom: 1px solid #eef2f1; color: inherit; background: #fff; text-align: left; transition: background .15s ease; }
.message-item:hover { background: #f8fbfa; }
.message-item.is-selected { position: relative; background: #eff8f7; }
.message-item.is-selected::before { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; content: ""; background: var(--teal); }
.message-item.is-unread .message-sender, .message-item.is-unread .message-subject { color: #203536; font-weight: 760; }
.message-avatar { display: inline-grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #397676; background: #e3f1ee; font-size: 11px; font-weight: 750; }
.message-summary { display: grid; min-width: 0; gap: 5px; }
.message-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.message-sender, .message-subject { overflow: hidden; color: #657473; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 580; }
.message-date { flex: 0 0 auto; color: #a2adab; font-size: 9px; }
.message-subject { color: #445656; font-size: 11px; }
.message-preview { overflow: hidden; color: #9aa5a3; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.empty-state { position: absolute; inset: 104px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; color: #718180; text-align: center; }
.empty-state h2 { margin: 14px 0 5px; color: #4d6060; font-size: 14px; }
.empty-state p { margin: 0; color: #9aa5a3; font-size: 11px; }
.empty-symbol { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 16px; color: var(--teal); background: var(--teal-soft); font-size: 22px; }
.detail-pane { min-width: 0; background: #fff; }
.detail-empty { display: flex; min-height: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 40px; color: #97a3a1; text-align: center; }
.empty-mark { position: relative; width: 68px; height: 52px; margin-bottom: 19px; border: 1.5px solid #dbe9e6; border-radius: 11px; background: #f7fbfa; }
.empty-mark::before, .empty-mark::after { position: absolute; top: 9px; width: 37px; height: 1px; content: ""; background: #b9d9d4; }
.empty-mark::before { left: 7px; transform: rotate(31deg); transform-origin: left; }
.empty-mark::after { right: 7px; transform: rotate(-31deg); transform-origin: right; }
.empty-mark span { position: absolute; top: 24px; left: 15px; width: 36px; height: 1px; background: #d8e7e4; }
.detail-empty h2 { margin: 0 0 7px; color: #627474; font-size: 14px; font-weight: 650; }
.detail-empty p { max-width: 270px; margin: 0; font-size: 11px; line-height: 1.7; }
.detail-content { min-height: 100%; }
.detail-toolbar { display: flex; align-items: center; gap: 8px; min-height: 62px; padding: 0 30px; border-bottom: 1px solid #eef2f1; }
.detail-toolbar-spacer { flex: 1; }
.detail-header { padding: 31px clamp(25px, 4vw, 54px) 21px; border-bottom: 1px solid #eef2f1; }
.detail-header h1 { margin: 7px 0 22px; color: #203536; font-size: clamp(21px, 2.4vw, 30px); font-weight: 680; letter-spacing: -.065em; line-height: 1.35; overflow-wrap: anywhere; }
.detail-sender-row { display: flex; align-items: center; gap: 11px; }
.sender-avatar { width: 36px; height: 36px; font-size: 12px; }
.sender-information { display: grid; min-width: 0; gap: 4px; }
.sender-information strong { overflow: hidden; color: #465958; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.sender-information span { overflow: hidden; color: #99a5a3; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.detail-date { margin-left: auto; padding-left: 12px; color: #9da8a6; font-size: 9px; white-space: nowrap; }
.message-body { max-width: 780px; padding: 27px clamp(25px, 4vw, 54px) 35px; color: #465656; font-size: 13px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment-list { padding: 0 clamp(25px, 4vw, 54px) 35px; }
.attachment-list > p { margin-bottom: 11px; }
.attachment-item { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; margin: 0 8px 8px 0; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; color: #456263; background: #fafcfb; text-decoration: none; font-size: 11px; }
.attachment-item:hover { border-color: #b9ded9; background: #f0f8f6; }
.attachment-size { color: #98a4a2; font-size: 9px; }
.compose-view { flex: 1; padding: clamp(18px, 4vw, 48px); }
.compose-card { width: min(100%, 840px); margin: 0 auto; padding: 26px 30px 21px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.compose-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 23px; }
.compose-header h1 { margin: 5px 0 0; font-size: 24px; font-weight: 690; letter-spacing: -.06em; }
.compose-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; min-height: 48px; border-top: 1px solid #edf1f0; }
.compose-row label, .compose-from-row > span:first-child { color: #84918f; font-size: 11px; }
.compose-row input { width: 100%; min-width: 0; height: 43px; border: 0; outline: 0; color: #334646; background: transparent; font-size: 12px; }
.compose-from-row { display: flex; align-items: center; gap: 12px; min-height: 44px; border-top: 1px solid #edf1f0; }
.compose-from-row strong { color: #738280; font-size: 10px; font-weight: 550; }
.from-lock { margin-left: auto; padding: 4px 7px; border-radius: 6px; color: #738280; background: #f1f5f4; font-size: 9px; }
#compose-text { display: block; width: 100%; min-height: 290px; padding: 18px 0; resize: vertical; border: 0; border-top: 1px solid #edf1f0; outline: 0; color: #405353; background: transparent; font-size: 13px; line-height: 1.8; }
.compose-footer { display: flex; align-items: center; gap: 12px; padding-top: 13px; border-top: 1px solid #edf1f0; }
.attach-button { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid #e4ecea; border-radius: 8px; color: #617271; cursor: pointer; font-size: 10px; }
.attach-button:hover { color: var(--teal); background: #f2f9f7; }
.attachment-hint { color: #a0aaa8; font-size: 9px; }
.compose-footer .button { margin-left: auto; min-width: 94px; }
.toast { position: fixed; right: 22px; bottom: 20px; z-index: 10; max-width: min(360px, calc(100vw - 40px)); padding: 12px 16px; border-radius: 11px; color: #fff; background: #193e42; box-shadow: 0 8px 30px rgba(12, 39, 41, .2); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; font-size: 12px; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #9e3e3e; }
.mobile-only { display: none; }
@media (max-width: 950px) {
  .mail-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .mailbox-layout { grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); }
  .topbar { padding: 0 20px; }
  .detail-header { padding-right: 24px; padding-left: 24px; }
  .message-body { padding-right: 24px; padding-left: 24px; }
}
@media (max-width: 720px) {
  .auth-layout { display: block; background: var(--paper); }
  .auth-brand { display: none; }
  .auth-main { min-height: 100vh; justify-content: flex-start; padding: 30px 22px 20px; background: var(--paper); }
  .auth-card { margin: auto 0; padding: 0; }
  .mobile-brand { display: inline-flex; margin-bottom: 36px; }
  .auth-card h2 { font-size: 27px; }
  .auth-legal { margin-top: 22px; }
  .mail-shell { display: block; min-height: 100vh; }
  .sidebar { min-height: 0; padding: 12px 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { font-size: 15px; }
  .sidebar-brand .brand-mark { width: 26px; height: 21px; }
  .button-compose { position: absolute; top: 8px; right: 15px; min-height: 37px; margin: 0; padding: 0 12px; font-size: 11px; }
  .button-compose .compose-plus { font-size: 16px; }
  .mail-nav { display: flex; gap: 6px; margin-top: 12px; }
  .nav-item { min-height: 34px; padding: 0 10px; font-size: 10px; }
  .nav-icon { font-size: 14px; }
  .nav-count { display: none; }
  .sidebar-bottom { position: absolute; top: 9px; right: 151px; margin: 0; }
  .account-card { gap: 0; padding: 0; border: 0; }
  .account-avatar { width: 28px; height: 28px; }
  .account-meta, .sidebar-caption { display: none; }
  .logout-button { width: 29px; height: 29px; margin-left: 5px; }
  .workspace { min-height: calc(100vh - 100px); }
  .topbar { height: 53px; padding: 0 15px; }
  .search-box { width: min(180px, 40vw); height: 33px; }
  .mailbox-layout { display: block; min-height: calc(100vh - 153px); }
  .list-pane { min-height: calc(100vh - 153px); border-right: 0; }
  .list-heading { min-height: 78px; padding: 16px 17px 13px; }
  .list-heading h1 { font-size: 21px; }
  .message-list { max-height: calc(100vh - 231px); }
  .message-item { padding-left: 17px; }
  .detail-pane { display: none; min-height: calc(100vh - 153px); }
  .mailbox-layout.has-selection .list-pane { display: none; }
  .mailbox-layout.has-selection .detail-pane { display: block; }
  .detail-empty { min-height: calc(100vh - 153px); }
  .detail-toolbar { min-height: 53px; padding: 0 13px; }
  .mobile-only { display: inline-grid; }
  .detail-header { padding: 22px 18px 19px; }
  .detail-header h1 { margin-bottom: 17px; font-size: 22px; }
  .detail-date { font-size: 8px; }
  .message-body { padding: 21px 18px 30px; font-size: 12px; }
  .attachment-list { padding: 0 18px 28px; }
  .compose-view { padding: 15px; }
  .compose-card { padding: 20px 16px 15px; border-radius: 14px; }
  .compose-header h1 { font-size: 21px; }
  .compose-row { grid-template-columns: 52px minmax(0, 1fr); }
  .compose-from-row { gap: 7px; }
  .compose-from-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #compose-text { min-height: 240px; }
}
@media (max-width: 410px) {
  .button-compose { width: 38px; min-width: 38px; padding: 0; overflow: hidden; font-size: 0; }
  .button-compose .compose-plus { font-size: 21px; }
  .sidebar-bottom { right: 59px; }
  .address-domain { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
