/* MT Point webmail. Same flat look as the panel: plain fills and 1px
   borders, no shadows, gradients, transitions or animations. */

:root {
  --bg: #eef0f2;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --border: #d3d7dc;
  --border-strong: #b8bec6;
  --text: #22272e;
  --muted: #5f6873;
  --accent: #0a66e4;
  --accent-dark: #0853b8;
  --accent-soft: #e6effc;
  --track: #e3e6ea;
  --crit: #c62828;
  --ok-bg: #e8f4ea; --ok-border: #b5d8bb; --ok-text: #1d5e2a;
  --err-bg: #fbeaea; --err-border: #e3b4b4; --err-text: #8f1d1d;
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; transition: none !important; animation: none !important; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--accent); }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2 { margin: 0; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.i {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------------------------------------------------------- controls */

label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 13px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], select, textarea {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
}
textarea { height: auto; padding: 10px; line-height: 1.5; resize: vertical; }
select { width: auto; height: 30px; padding: 0 6px; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input::placeholder { color: #8d949c; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent-dark); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon-only { min-width: 30px; padding: 0 8px; font-size: 16px; }
.btn.off { color: var(--border-strong); background: var(--surface); }
.btn.danger { color: var(--crit); border-color: var(--err-border); }
.btn.danger:hover { background: var(--err-bg); }
.btn.wide { display: flex; width: 100%; height: 42px; margin-top: 8px; }

.notice { margin: 0 0 14px; padding: 8px 10px; border: 1px solid; border-radius: 2px; font-size: 13px; }
.notice.ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.notice.warn { background: #fdf5e0; border-color: #ead08a; color: #6f5000; }
.notice.err { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }
.notice p { margin: 0 0 8px; }

/* ---------------------------------------------------------------- login */

.is-login { display: flex; flex-direction: column; }
.login { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login-box {
  width: 100%;
  max-width: 440px;
  padding: 40px 48px 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.login-logo { display: block; margin: 0 auto 32px; max-width: 100%; height: auto; }
.login-box h1 { margin: 0 0 22px; padding-top: 26px; border-top: 1px solid var(--border); font-size: 17px; font-weight: 600; }
.login-box input { height: 42px; margin-bottom: 18px; }

/* ---------------------------------------------------------------- shell */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 54px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; width: 204px; flex: none; color: var(--text); font-size: 16px; font-weight: 600; text-decoration: none; }
.search { position: relative; flex: 1; max-width: 560px; }
.search .i { position: absolute; left: 10px; top: 11px; color: var(--muted); }
.search input { height: 36px; padding-left: 34px; background: var(--surface-2); }
.account { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.account-mail { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account form { margin: 0; }

.shell { display: flex; align-items: flex-start; }
.side {
  position: sticky;
  top: 54px;
  flex: none;
  width: 236px;
  height: calc(100vh - 54px);
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}
.compose-btn { display: flex; width: 100%; height: 40px; margin-bottom: 14px; }
.folders { margin: 0; padding: 0; list-style: none; }
.folders a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: 2px;
  color: var(--text);
  text-decoration: none;
}
.folders a:hover { background: var(--track); }
.folders a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.folders .i { color: var(--muted); }
.folders a[aria-current="page"] .i { color: var(--accent); }
.f-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font-size: 12px; font-weight: 600; color: var(--accent-dark); }
.quota { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.quota p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
progress { display: block; width: 100%; height: 4px; border: 0; background: var(--track); appearance: none; }
progress::-webkit-progress-bar { background: var(--track); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

.main { flex: 1; min-width: 0; padding: 20px 24px 40px; }

/* ---------------------------------------------------------------- list */

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-head h1 { font-size: 20px; font-weight: 600; }
.pager { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; }
.confirm form { display: flex; gap: 8px; }

.mails { background: var(--surface); border: 1px solid var(--border); border-radius: 2px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.move { display: inline-flex; gap: 4px; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.rows li:last-child { border-bottom: 0; }
.rows li:hover { background: var(--surface-2); }
.pick { display: flex; align-items: center; margin: 0; padding: 0 4px 0 12px; cursor: pointer; }
.pick input { width: 16px; height: 16px; margin: 0; }
.row {
  flex: 1;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 10px 12px 10px 8px;
  color: var(--text);
  text-decoration: none;
}
.who, .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prev { color: var(--muted); }
.meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.clip .i { width: 14px; height: 14px; }
.unread .who, .unread .subj-text { font-weight: 700; }
.unread .meta time { color: var(--text); font-weight: 600; }
.empty { padding: 40px 16px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- message */

.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 13px; text-decoration: none; }
.back:hover { color: var(--text); }
.msg { padding: 20px 24px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 2px; }
.msg h1 { margin-bottom: 14px; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.msg-form { display: contents; }
.hdrs { margin: 14px 0; font-size: 13px; }
.hdrs div { display: flex; gap: 12px; padding: 2px 0; }
.hdrs dt { width: 44px; flex: none; color: var(--muted); }
.hdrs dd { margin: 0; overflow-wrap: anywhere; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.atts a, .atts label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}
.atts a:hover { border-color: var(--border-strong); }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.images-off { margin: 0 0 10px; padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.body-html { display: block; width: 100%; height: 70vh; min-height: 360px; border: 1px solid var(--border); background: #fff; resize: vertical; overflow: auto; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; }
.body-text .q { color: var(--muted); }

/* ---------------------------------------------------------------- compose */

.compose-title { margin-bottom: 12px; font-size: 20px; font-weight: 600; }
.compose { padding: 16px 20px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 2px; }
.field { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.field label { width: 64px; flex: none; margin: 0; }
.field input { flex: 1; }
.compose textarea { margin: 6px 0 12px; min-height: 280px; }
.keep { margin-bottom: 10px; }
.keep input { width: 15px; height: 15px; margin: 0; }
.files label { display: inline-flex; align-items: center; gap: 6px; width: auto; }
.files input { height: auto; border: 0; padding: 0; }
.compose-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 860px) {
  .brand { width: auto; }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 10px; }
  .row .who { grid-column: 1; grid-row: 1; }
  .row .meta { grid-column: 2; grid-row: 1; }
  .row .subj { grid-column: 1 / span 2; grid-row: 2; }
}

@media (max-width: 720px) {
  .top { flex-wrap: wrap; height: auto; gap: 8px 12px; padding: 8px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .account-mail, .hide-s { display: none; }
  .shell { display: block; }
  .side {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .compose-btn { width: auto; height: 34px; margin: 0; flex: none; }
  .folders { display: flex; gap: 4px; }
  .folders a { height: 34px; white-space: nowrap; }
  .f-name { overflow: visible; }
  .quota { display: none; }
  .main { padding: 14px 16px 32px; }
  .msg, .compose { padding: 14px; }
  .field { display: block; }
  .field label { width: auto; margin-bottom: 4px; }
  .login-box { padding: 28px 22px 32px; }
}
