/* Copyright (c) 2026 ИП Оганнисян Акоп. Все права защищены. */
:root {
  --blue: #1f3864;
  --blue-dark: #15274a;
  --red: #dc2626;
  --ink: #242424;
  --muted: #5b6470;
  --line: #e6e4e1;
  --paper: #f5f5f5;
  --select: #e8eef8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }

.login {
  min-height: 100%;
  display: flex;
  background: #fff;
}
.login-brand, .login-form {
  flex: 1 1 50%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-brand { background: #fff; padding: 32px 24px; text-align: center; }
.login-brand img, .login-brand video {
  width: min(280px, 72vw);
  height: auto;
  max-height: 46vh;
  display: block;
  object-fit: contain;
  background: #fff;
}
.login-name {
  margin-top: 18px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue);
}
.login-hint { margin-top: 8px; font-size: 14px; color: var(--muted); }
.login-form { background: var(--blue); color: #fff; padding: 32px 24px; }
.login-card { width: min(440px, 100%); }
.field { display: block; margin: 0 0 18px; }
.field > span:not(.control) { display: block; font-size: 12px; margin-bottom: 4px; }
.star { margin-left: 2px; }
.control {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  padding: 4px 0 6px;
}
.control svg { width: 18px; height: 18px; fill: #fff; stroke: none; flex: 0 0 auto; }
.control input, .control select {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  padding: 4px 0;
  min-width: 0;
}
.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  transition: background-color 600000s 0s;
}
.control select { appearance: none; }
.control select option { color: var(--blue); }
.eye {
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0;
  width: 28px;
  height: 28px;
}
.eye svg { width: 20px; height: 20px; fill: none; stroke: #fff; }
.login-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px 12px;
  margin-top: 8px;
}
.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}
.remember input { position: absolute; opacity: 0; }
.switch {
  width: 36px;
  height: 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.35);
  position: relative;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
}
.remember input:checked + .switch { background: rgba(220, 38, 38, 0.7); }
.remember input:checked + .switch::after { left: 18px; background: var(--red); }
.about {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-style: italic;
  line-height: 1;
}
.submit {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  grid-row: 1 / span 2;
  grid-column: 2;
}
.submit svg { width: 26px; height: 26px; }
.submit:hover { background: #b91c1c; }
.submit:disabled { opacity: 0.7; }
.login-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #fecaca;
  font-size: 14px;
}
.filebox {
  grid-column: 1 / -1;
  justify-self: center;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
.filebox:hover { text-decoration: underline; }

.app {
  height: 100%;
  display: flex;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(31, 56, 100, 0.08), transparent 60%),
    radial-gradient(700px 380px at 100% 100%, rgba(220, 38, 38, 0.07), transparent 55%),
    var(--paper);
  color: var(--ink);
}
.rail {
  width: 120px;
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  flex: 0 0 auto;
}
.rail-btn {
  width: 112px;
  border: 0;
  background: transparent;
  color: #fff;
  border-radius: 8px;
  padding: 8px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn span { font-size: 10px; line-height: 1.15; text-align: center; max-width: 104px; overflow-wrap: anywhere; }
.rail-btn.is-on, .rail-btn:hover { background: rgba(255, 255, 255, 0.14); }
.rail-lang { cursor: pointer; margin-bottom: 4px; }
.rail-lang select {
  width: 100px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.16); color: #fff;
  font: inherit; font-size: 10px; padding: 2px 0; text-align: center; cursor: pointer;
}
.rail-lang select option { color: #15274a; }
.rail-lang .gm-lang-btn {
  width: 100px; justify-content: center; gap: 4px; border: 0; border-radius: 6px;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 10px; padding: 3px 4px;
}
.rail-lang .gm-lang-btn svg.gm-flag { width: 16px; height: 11px; }
.control .gm-lang-btn { flex: 1; border: 0; background: transparent; color: #fff; padding: 4px 0; }
.rail-gap { flex: 1; }
.who {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
}
.workspace { flex: 1; min-width: 0; display: flex; gap: 8px; padding: 8px; }
.view-wide { display: block; }
.folders, .list-pane, .reader, .panel-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
}
.folders { width: 240px; flex: 0 0 auto; padding: 12px; overflow: auto; position: relative; }
.new-mail {
  width: 100%;
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.new-mail svg { width: 18px; height: 18px; }
.new-mail:hover { background: var(--blue-dark); }
.new-folder {
  width: 100%;
  margin-top: 2px;
  border: 0;
  background: transparent;
  color: #8b93a0;
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.new-folder svg { width: 16px; height: 16px; color: var(--blue); stroke-width: 1.6; }
.new-folder:hover { background: var(--select); color: var(--blue); }
.folder-form {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.folder-form input, .folder-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--ink);
  background: #fff;
}
.folder-where { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.folder-where select { margin-top: 4px; }
.folder-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.folder-actions { display: flex; gap: 8px; margin-top: 8px; }
.folder-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
}
.folder-actions button[type="submit"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.folder-error { margin: 8px 0 0; color: var(--red); font-size: 12px; }
.account {
  margin: 16px 4px 8px;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}
.folders ul, .list-pane ul { list-style: none; margin: 0; padding: 0; }
.folders li {
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.folders li.is-on, .folders li:hover { background: var(--select); }
.badge {
  min-width: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
}
.list-pane { width: 360px; flex: 0 0 auto; display: flex; flex-direction: column; }
.list-head { padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.list-head h1 { margin: 0 0 8px; font-size: 20px; }
.search-wrap { position: relative; display: block; }
.search-wrap .glass {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  color: var(--muted);
  pointer-events: none;
}
.list-head input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px 8px 34px;
  background: var(--paper);
}
#message-list { overflow: auto; flex: 1; }
#message-list li {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
#message-list li[draggable="true"] { cursor: grab; user-select: none; -webkit-user-drag: element; }
#message-list li.is-dragging { opacity: 0.4; cursor: grabbing; }
.folders li.drop-on {
  background: #d5e2f6;
  box-shadow: inset 0 0 0 2px var(--blue);
}
.folders li[draggable="true"] { cursor: grab; user-select: none; -webkit-user-drag: element; }
.folders li.is-child { box-shadow: inset 3px 0 0 #c5d4ee; }
.folder-note { margin: 6px 2px 0; font-size: 12px; color: var(--blue); }
.folder-move {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--blue);
  padding: 0;
  display: grid;
  place-items: center;
}
.folder-move svg { width: 14px; height: 14px; }
.folder-move:hover, .folder-move[aria-expanded="true"] { background: #d5e2f6; }
.folder-move-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 4;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(21, 39, 74, 0.16);
  padding: 4px;
  max-height: 220px;
  overflow: auto;
}
.folder-move-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--ink);
}
.folder-move-menu button:hover { background: var(--select); }
.folders li.is-dragging { opacity: 0.4; }
.folder-root-drop {
  margin: 2px 0 6px;
  padding: 8px 10px;
  border: 1px dashed #b9cceb;
  border-radius: 6px;
  color: var(--blue);
  font-size: 13px;
  text-align: center;
}
.folder-root-drop.drop-on {
  background: #d5e2f6;
  border-style: solid;
}
#message-list li.is-on { background: var(--select); }
#message-list li.unseen .subject { font-weight: 700; }
.subject { display: block; }
.from { color: var(--ink); }
.meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
}
.reader { flex: 1; min-width: 0; overflow: auto; padding: 18px 22px; }
.empty-read, .people-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.people-empty { align-content: center; }
.people-empty h1 { margin-bottom: 8px; color: var(--ink); }
.read-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.read-tools button, .compose footer button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tool-ico, #compose-send .plane { width: 16px; height: 16px; flex: 0 0 auto; }
.compose footer button:hover { background: var(--paper); }
#compose-send { background: var(--blue); color: #fff; border-color: var(--blue); }
.read-tools button.act { font-weight: 600; padding: 6px 12px 6px 8px; }
.read-tools .tool-ico {
  width: 18px;
  height: 18px;
  padding: 4px;
  border-radius: 6px;
  box-sizing: content-box;
  stroke-width: 2.2;
  background: #fff;
}
.read-tools button.act-reply { color: #1f3864; background: #e7eef9; border-color: #b9cceb; }
.read-tools button.act-reply .tool-ico { color: #1f3864; }
.read-tools button.act-reply:hover { background: #d5e2f6; }
.read-tools button.act-forward { color: #0f6b4c; background: #e5f6ee; border-color: #b7e4cf; }
.read-tools button.act-forward .tool-ico { color: #0f6b4c; }
.read-tools button.act-forward:hover { background: #d3f0e3; }
.read-tools button.act-spam { color: #9a3412; background: #fff1e6; border-color: #f3c7a6; }
.read-tools button.act-spam .tool-ico { color: #c2410c; }
.read-tools button.act-spam:hover { background: #ffe4d1; }
.read-tools button.act-ham { color: #0f6b4c; background: #e5f6ee; border-color: #b7e4cf; }
.read-tools button.act-ham .tool-ico { color: #0f6b4c; }
.read-tools button.act-ham:hover { background: #d3f0e3; }
.read-tools button.act-delete { color: #fff; background: #dc2626; border-color: #dc2626; }
.read-tools button.act-delete .tool-ico { color: #fff; background: rgba(255, 255, 255, 0.16); }
.read-tools button.act-delete:hover { background: #b91c1c; border-color: #b91c1c; }
.read-tools button.act-rule { color: #5b3cc4; background: #f3eefe; border-color: #d9ccf5; }
.read-tools button.act-rule .tool-ico { color: #5b3cc4; }
.read-tools button.act-rule:hover { background: #e6dbfb; }
.filter-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 180px; overflow: auto; }
.filter-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.filter-list button {
  border: 0;
  background: transparent;
  color: var(--red);
  padding: 0;
  flex: 0 0 auto;
}
.folder-ico.inbox { color: #1f3864; }
.folder-ico.sent { color: #0f6b4c; }
.folder-ico.draft { color: #6d28d9; }
.folder-ico.spam { color: #c2410c; }
.folder-ico.trash { color: #dc2626; }
.folder-ico.archive { color: #0e7490; }
.read-subject { margin: 0 0 8px; font-size: 22px; }
.read-from { margin: 0; }
.read-to, .read-date { margin: 2px 0; color: var(--muted); font-size: 13px; }
.attach { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.attach a {
  color: var(--blue);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
.body-text { white-space: pre-wrap; line-height: 1.45; }
.body-frame { width: 100%; min-height: 360px; border: 0; background: #fff; }
.calendar-card { height: calc(100% - 0px); padding: 16px 18px; overflow: auto; }
.cal-head { display: flex; align-items: center; gap: 12px; }
.cal-head h1 { flex: 1; margin: 0; font-size: 22px; }
.cal-head button {
  width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: 22px;
}
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekdays { margin-top: 12px; color: var(--muted); font-size: 12px; }
.cal-weekdays span, .cal-grid > div { padding: 8px; }
.cal-grid > div { min-height: 72px; border-top: 1px solid var(--line); }
.cal-grid .out { color: #b0b6bd; }
.cal-grid .today { background: var(--select); border-radius: 6px; font-weight: 700; }
.cal-grid > div { cursor: pointer; min-width: 0; }
.cal-num { display: block; border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.cal-num:hover { color: var(--blue); text-decoration: underline; }
.cal-events { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.cal-event {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 4px; padding: 1px 4px;
  background: #e7eef9; font: inherit; font-size: 11px; line-height: 1.35; color: var(--blue);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cal-event:hover { background: #d5e2f6; }
.cal-event.all-day { background: var(--blue); color: #fff; }
.cal-more { border: 0; background: transparent; padding: 0 4px; font-size: 11px; color: var(--muted); text-align: left; cursor: pointer; }
.cal-head .cal-today { width: auto; font-size: 14px; padding: 0 12px; }
.cal-views { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.cal-head .cal-views button {
  width: auto; height: auto; border: 0; border-radius: 0; background: #fff; padding: 8px 12px; font-size: 13px;
  color: var(--ink); cursor: pointer;
}
.cal-head .cal-views button + button { border-left: 1px solid var(--line); }
.cal-head .cal-views button.is-on { background: var(--blue); color: #fff; }
.cal-time { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tg-row { display: grid; border-bottom: 1px solid var(--line); }
.tg-day {
  border: 0; border-left: 1px solid var(--line); background: #fff; padding: 8px 4px; font: inherit; font-size: 13px;
  color: var(--muted); cursor: pointer;
}
.tg-day.today { color: var(--blue); font-weight: 700; }
.tg-label { font-size: 11px; color: var(--muted); padding: 6px 4px; text-align: right; }
.tg-cell { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 26px; }
.tg-scroll { height: min(560px, calc(100vh - 330px)); min-height: 280px; overflow: auto; }
.tg-body { display: grid; position: relative; }
.tg-hours { position: relative; }
.tg-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.tg-hours span:first-child { transform: none; }
.tg-col {
  position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 44px);
}
.tg-event {
  position: absolute; overflow: hidden; border: 0; border-left: 3px solid var(--blue); border-radius: 4px;
  background: #e7eef9; color: var(--blue); padding: 2px 4px; font: inherit; font-size: 12px; line-height: 1.3;
  text-align: left; cursor: pointer; z-index: 1;
}
.tg-event:hover { background: #d5e2f6; z-index: 2; }
.tg-where { display: block; color: var(--muted); font-size: 11px; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.cal-detail {
  margin-top: 12px; padding: 12px 14px; border: 1px solid #b9cceb; border-radius: 8px; background: #f6f9fe;
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
}
.cal-detail h2 { margin: 0 0 4px; font-size: 17px; }
.cal-detail p { margin: 2px 0; font-size: 13px; }
.cal-detail-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.cal-detail-actions button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.cal-detail-actions .danger { background: var(--red); border-color: var(--red); color: #fff; }
.people-list { overflow: auto; flex: 1; }
.people-list li {
  display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.people-list li.is-on, .people-list li:hover { background: var(--select); }
.people-list .people-empty-row { color: var(--muted); cursor: default; }
.people-list .people-empty-row:hover { background: transparent; }
.people-list .who { display: flex; flex-direction: column; min-width: 0; }
.people-list .name { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people-list .sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; background: #e7eef9; color: var(--blue);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.avatar.big { width: 52px; height: 52px; font-size: 22px; }
.person-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.person-head h2 { margin: 0; font-size: 22px; }
.person-lines { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.person-lines dt { color: var(--muted); font-size: 13px; }
.person-lines dd { margin: 0; }
.person-lines a { color: var(--blue); text-decoration: none; }
.person-note { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.person-form h2 { margin: 0 0 12px; font-size: 20px; }
.person-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.person-form label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.person-form input, .person-form textarea {
  display: block; width: 100%; box-sizing: border-box; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; color: var(--ink); background: #fff; font: inherit;
}
.person-form textarea { resize: vertical; }
#pf-save { background: var(--blue); color: #fff; border-color: var(--blue); }
.compose-later {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line);
  background: #f6f9fe; color: var(--muted); font-size: 13px;
}
.compose-later button { border: 1px solid #b9cceb; background: #fff; color: var(--blue); border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.compose-later input { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; color: var(--ink); }
.compose-actions { display: flex; gap: 8px; margin-left: auto; }
#compose-later-toggle.is-on { background: #e7eef9; border-color: #b9cceb; color: var(--blue); }
.scheduled-list { max-height: 320px; }
.scheduled-list li { align-items: flex-start; }
.scheduled-list button { color: var(--red); }
.sched-sent { color: var(--muted); }
.sched-error { color: var(--red); }
.cal-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cal-form input, .cal-form button { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.cal-form button { background: var(--blue); color: #fff; border-color: var(--blue); cursor: pointer; }
.thread-count { margin-left: 6px; font-size: 11px; color: var(--blue); }
.thread-more { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.thread-more button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.thread-more button.is-on { border-color: var(--blue); color: var(--blue); }
.soon { color: var(--muted); }

.compose {
  position: fixed;
  right: 24px;
  bottom: 0;
  width: min(560px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 28px rgba(21, 39, 74, 0.2);
  z-index: 5;
}
.compose form { display: flex; flex-direction: column; }
.compose header, .compose footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--blue);
  color: #fff;
}
.compose footer { background: #fff; color: inherit; }
.compose header button {
  border: 0; background: transparent; color: #fff; font-size: 22px; line-height: 1;
}
.compose label { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pick-contact {
  width: 28px; height: 28px; flex: 0 0 auto; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--blue);
  display: grid; place-items: center;
}
.pick-contact:hover, .pick-contact[aria-expanded="true"] { background: var(--select); }
.compose-to span { flex: 0 0 auto; }
.contact-picker { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); }
.contact-picker input {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-bottom: 6px;
}
.contact-picker ul { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow: auto; }
.contact-picker li button {
  width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 4px; border-radius: 6px;
}
.contact-picker li button:hover { background: var(--select); }
.contact-picker .who { display: block; color: var(--ink); }
.contact-picker .mail { display: block; color: var(--muted); font-size: 12px; }
.contact-empty { margin: 0; color: var(--muted); font-size: 13px; }
.compose input, .compose textarea {
  flex: 1; border: 0; outline: 0; color: var(--ink); resize: vertical;
}
#compose-error { color: var(--red); margin: 0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(21, 39, 74, 0.45);
  display: grid;
  place-items: center;
  z-index: 6;
  padding: 16px;
}
.modal-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 10px;
  padding: 18px 18px 14px;
  box-shadow: 0 16px 40px rgba(21, 39, 74, 0.25);
}
.modal-card h2 { margin: 0 0 12px; font-size: 20px; }
.modal-card label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.modal-card textarea { box-sizing: border-box; font: inherit; resize: vertical; }
.modal-card input, .modal-card select, .modal-card textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}
.modal-card .check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.modal-card .check input { width: auto; margin: 0; }
.mig-hint, .mig-status { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.mig-status.error { color: var(--red); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
}
#mig-start { background: var(--blue); color: #fff; border-color: var(--blue); }

.folder-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.folder-ico { width: 16px; height: 16px; flex: 0 0 auto; color: var(--blue); }
.pick-contact svg { width: 18px; height: 18px; }

svg.motion { overflow: visible; }
svg.motion * { transform-box: fill-box; transform-origin: center; }

@keyframes flap {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1.6px); }
}
@keyframes pin {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(2px); }
}
@keyframes pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}
@keyframes mate {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(1.6px); }
}
@keyframes lift {
  0% { transform: translateY(2px); opacity: 0.35; }
  100% { transform: translateY(-2px); opacity: 1; }
}
@keyframes slide-up {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2px, -1px); }
}
@keyframes slide-down {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2px, 1px); }
}
@keyframes slip {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}
@keyframes tilt {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-10deg); }
}
@keyframes fly {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4px, -4px); }
}
@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
@keyframes lid {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-12deg); }
}
@keyframes look {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(16deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.72); opacity: 0.55; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.rail-btn.is-on .mail .flap,
.rail-btn:hover .mail .flap,
.folders li.is-on .inbox .flap,
.folders li:hover .inbox .flap { animation: flap 1.4s ease-in-out infinite; }
.rail-btn.is-on .cal .pin,
.rail-btn:hover .cal .pin { animation: pin 1.15s ease-in-out infinite; }
.rail-btn .cal .pin.late { animation-delay: 0.12s; }
.rail-btn.is-on .cal .dot,
.rail-btn:hover .cal .dot { animation: pop 1.15s ease-in-out infinite; }
.rail-btn.is-on .people .mate,
.rail-btn:hover .people .mate { animation: mate 1.5s ease-in-out infinite; }
.rail-btn:hover .cloud .lift,
.rail-btn.is-on .cloud .lift { animation: lift 1s ease-in-out infinite alternate; }
.rail-btn:hover .migrate .up,
.rail-btn.is-on .migrate .up { animation: slide-up 1.1s ease-in-out infinite; }
.rail-btn:hover .migrate .down,
.rail-btn.is-on .migrate .down { animation: slide-down 1.1s ease-in-out infinite; }
.rail-btn:hover .leave .out { animation: slip 0.7s ease-in-out infinite; }
.submit .go { animation: slip 1.6s ease-in-out infinite; }
.submit:hover .go { animation-duration: 0.55s; }
.eye:hover .pupil { animation: pop 0.7s ease-in-out infinite; }
.field:focus-within .control > svg { animation: bob 1.1s ease-in-out infinite; }
.new-mail .pen { transform-origin: 70% 30%; animation: tilt 2.4s ease-in-out infinite; }
.new-folder:hover .plus { animation: pop 0.7s ease-in-out infinite; }
.new-mail:hover .pen { animation-duration: 0.7s; }
.search-wrap:focus-within .glass { transform-origin: 11px 11px; animation: look 1.1s ease-in-out infinite; }
.pick-contact:hover .head,
.pick-contact[aria-expanded="true"] .head { animation: pop 0.8s ease-in-out infinite; }
#compose-send .plane { animation: fly 1.8s ease-in-out infinite; }
#compose-send:hover .plane { animation-duration: 0.55s; }
.folders li.is-on .sent .plane,
.folders li:hover .sent .plane { animation: fly 1.1s ease-in-out infinite; }
.folders li.is-on .draft .nib,
.folders li:hover .draft .nib,
.read-tools button:hover .reply,
.read-tools button:hover .forward { animation: slip 0.7s ease-in-out infinite; }
.folders li.is-on .spam .shield,
.folders li:hover .spam .shield,
.read-tools button:hover .spam .shield { animation: shake 0.7s ease-in-out infinite; }
.folders li.is-on .trash .lid,
.folders li:hover .trash .lid,
.read-tools button:hover .trash .lid { animation: lid 0.8s ease-in-out infinite; transform-origin: left center; }
.folders li.is-on .archive .box,
.folders li:hover .archive .box { animation: bob 1.2s ease-in-out infinite; }
.badge { animation: pulse 2s ease-in-out infinite; }
#message-list li.unseen .from::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--red);
  vertical-align: 1px;
  animation: pulse 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .motion, .motion *, .badge, .submit .go, .new-mail .pen, #compose-send .plane,
  .field:focus-within .control > svg, #message-list li.unseen .from::before {
    animation: none !important;
  }
}

@media (max-width: 960px) {
  .login { flex-direction: column; }
  .login-brand, .login-form { min-height: auto; flex-basis: auto; }
  .login-brand { padding-top: 40px; }
  .login-form { min-height: 70vh; }
  .workspace { flex-direction: column; }
  .folders, .list-pane { width: auto; }
  .list-pane { max-height: 40vh; }
}
