/* 春日野メール */
:root {
  --g: #2f7d62; --g2: #e6f2ed; --g3: #cfe6dc;
  --tx: #1f2328; --mu: #5f6368; --ln: #e3e6e8; --bg: #f6f8fa;
  --unread-bg: #fff; --read-bg: #f5f7f8;
  --top-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif; color: var(--tx); background: var(--bg); }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ログイン */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--g2); }
.login-box { background: #fff; padding: 32px 28px; border-radius: 14px; width: min(360px, 92vw); box-shadow: 0 6px 24px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 14px; }
.login-logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: var(--g); }
.login-logo img { width: 36px; }
.login-sub { margin: -8px 0 4px; color: var(--mu); }
.login-err { margin: 0; color: #c5221f; background: #fce8e6; padding: 8px 10px; border-radius: 8px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--mu); }
.login-box input { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #cfd4d8; border-radius: 8px; }
.login-box button { margin-top: 6px; padding: 11px; border: 0; border-radius: 8px; background: var(--g); color: #fff; font-size: 16px; font-weight: 600; }

/* 上の帯 */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--ln); z-index: 30; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--g); white-space: nowrap; min-width: 200px; }
.brand img { width: 30px; }
.search { flex: 1; max-width: 720px; display: flex; align-items: center; background: #eef1f3; border-radius: 24px; padding: 0 6px 0 14px; height: 42px; }
.search:focus-within { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.search input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 15px; outline: none; padding: 0 8px; min-width: 0; }
.search-ic { opacity: .55; font-size: 14px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.sync { color: var(--mu); font-size: 12px; }
.who { font-weight: 600; }
.logout { color: var(--mu); font-size: 13px; }
.logout:hover { color: var(--tx); text-decoration: underline; }
.ic { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; color: var(--mu); display: inline-flex; align-items: center; justify-content: center; }
.ic:hover { background: #eceff1; color: var(--tx); }
.ic.sm { width: 24px; height: 24px; font-size: 15px; }
.menu-btn { display: none; }

/* 左 */
.wrap { display: flex; padding-top: var(--top-h); height: 100vh; }
.side { width: 240px; flex: none; overflow-y: auto; padding: 8px 8px 24px 0; }
.nv { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 12px 0 22px; border-radius: 0 17px 17px 0; color: var(--tx); white-space: nowrap; overflow: hidden; }
.nv:hover { background: #eaedf0; }
.nv.on { background: var(--g3); font-weight: 700; color: #134e3a; }
.nv-ic { width: 20px; text-align: center; font-size: 15px; flex: none; }
.nv-t { overflow: hidden; text-overflow: ellipsis; }
.nv-n { margin-left: auto; font-size: 12px; font-weight: 700; }
.nv-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; margin: 0 4px; }
.side-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 4px 22px; font-size: 13px; font-weight: 700; color: var(--mu); }
.side-h small { font-weight: 400; }
.scrim { display: none; }

/* 真ん中 */
.main { flex: 1; min-width: 0; background: #fff; margin: 0 12px 12px 0; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.main > section { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.bar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--ln); min-height: 48px; flex: none; }
.ck-all { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.view-title { font-weight: 700; margin-left: 6px; color: var(--mu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { margin-left: auto; display: flex; align-items: center; gap: 2px; color: var(--mu); font-size: 12px; white-space: nowrap; }
.tb { border: 1px solid #d5d9dd; background: #fff; border-radius: 16px; padding: 4px 12px; font-size: 13px; color: var(--tx); white-space: nowrap; }
.tb:hover { background: #f1f3f4; }
.tb.pri { background: var(--g); border-color: var(--g); color: #fff; }
.tb.pri:hover { background: #276a53; }
.tb.danger { color: #c5221f; }

/* 一覧 */
.list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.row { display: flex; align-items: center; gap: 4px; padding: 0 12px 0 6px; height: 44px; border-bottom: 1px solid #eef0f2; background: var(--read-bg); cursor: pointer; }
.row.unread { background: var(--unread-bg); }
.row.unread .r-who, .row.unread .r-subj, .row.unread .r-date { font-weight: 700; color: #111; }
.row:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(60,64,67,.25); position: relative; z-index: 1; }
.row.sel { background: #e8f0fe; }
.row input { width: 16px; height: 16px; }
.r-ck { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.r-star { border: 0; background: transparent; font-size: 17px; color: #b0b5ba; width: 28px; flex: none; padding: 0; }
.r-star.on { color: #f4b400; }
.r-who { width: 190px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3c4043; }
.r-who .n { color: var(--mu); font-weight: 400; font-size: 12px; margin-left: 3px; }
.r-main { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--mu); }
.r-subj { color: #3c4043; }
.r-snip { color: var(--mu); }
.r-att { flex: none; color: var(--mu); font-size: 13px; }
.r-date { width: 72px; flex: none; text-align: right; font-size: 12px; color: var(--mu); }
.chip { display: inline-block; font-size: 11px; line-height: 17px; padding: 0 6px; border-radius: 4px; margin-right: 4px; color: #fff; vertical-align: 1px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.chip.fd { background: #e8eaed; color: #3c4043; }
.empty { text-align: center; color: var(--mu); padding: 60px 20px; }

/* スレッド */
.thread { overflow-y: auto; flex: 1; padding: 8px 20px 40px 20px; }
.t-subj { font-size: 22px; font-weight: 400; margin: 12px 0 6px 52px; word-break: break-word; }
.t-labels { margin: 0 0 14px 52px; }
.t-labels .chip { font-size: 12px; line-height: 20px; }
.msg { border-bottom: 1px solid #eef0f2; }
.msg-h { display: flex; gap: 12px; padding: 12px 0; cursor: pointer; align-items: flex-start; }
.av { width: 40px; height: 40px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; font-size: 16px; }
.msg-meta { flex: 1; min-width: 0; }
.msg-from { font-weight: 700; }
.msg-from .addr { font-weight: 400; color: var(--mu); font-size: 12px; margin-left: 4px; }
.msg-to { color: var(--mu); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.closed .msg-to { display: none; }
.msg-snip { color: var(--mu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: none; }
.msg.closed .msg-snip { display: block; }
.msg-date { color: var(--mu); font-size: 12px; white-space: nowrap; text-align: right; }
.msg-date .fd { display: block; font-size: 11px; }
.msg-b { padding: 0 0 16px 52px; }
.msg.closed .msg-b { display: none; }
.msg-b iframe { width: 100%; border: 0; display: block; }
.img-note { background: #fef7e0; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
.img-note button { border: 0; background: none; color: #1a73e8; padding: 0 4px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--ln); }
.att { display: flex; align-items: center; gap: 8px; border: 1px solid var(--ln); border-radius: 8px; padding: 6px 10px; max-width: 320px; background: #fafbfc; }
.att:hover { border-color: #b9c0c6; background: #fff; }
.att-ic { font-size: 20px; }
.att-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.att-s { color: var(--mu); font-size: 11px; }
.att-dl { color: var(--mu); font-size: 12px; margin-left: 4px; }
.msg-tools { margin-top: 10px; font-size: 12px; color: var(--mu); display: flex; gap: 14px; flex-wrap: wrap; }
.msg-tools a { color: var(--mu); text-decoration: underline; }
.read-by { color: var(--mu); font-size: 11px; }

/* ポップアップ */
.pop { position: fixed; z-index: 50; background: #fff; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.2); width: 260px; padding: 8px 0; }
.pop-h { font-size: 13px; color: var(--mu); padding: 4px 14px 8px; }
.pop-list { max-height: 300px; overflow-y: auto; }
.pop-list label { display: flex; align-items: center; gap: 8px; padding: 6px 14px; cursor: pointer; }
.pop-list label:hover { background: #f1f3f4; }
.pop-new { display: flex; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--ln); }
.pop-new input { flex: 1; min-width: 0; font: inherit; padding: 4px 8px; border: 1px solid #d5d9dd; border-radius: 6px; }
.pop-foot { text-align: right; padding: 4px 14px 2px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow-y: auto; }
.modal-box { background: #fff; border-radius: 14px; width: min(760px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; font-size: 18px; font-weight: 700; padding: 14px 16px 8px 22px; }
.modal-b { padding: 0 22px 22px; }
.modal-b h3 { font-size: 15px; margin: 18px 0 6px; }
.hint { color: var(--mu); font-size: 13px; margin: 0 0 10px; }
.rule-new { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.rule-new input, .rule-new select, .labels-t input { font: inherit; padding: 5px 8px; border: 1px solid #cfd4d8; border-radius: 6px; }
#r-value { flex: 1; min-width: 160px; }
.r-ex { font-size: 13px; color: var(--mu); }
.rules, .labels-t { width: 100%; border-collapse: collapse; }
.rules td, .labels-t td { border-top: 1px solid var(--ln); padding: 6px 4px; }
.rules td:last-child, .labels-t td:last-child { text-align: right; white-space: nowrap; }
.labels-t input[type=color] { width: 34px; height: 28px; padding: 0 2px; vertical-align: middle; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #323232; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 80; max-width: 90vw; }

/* スマホ・タブレット */
@media (max-width: 860px) {
  :root { --top-h: 54px; }
  .menu-btn { display: inline-flex; }
  .brand { min-width: 0; }
  .brand, .sync, .who { display: none; }
  .top { gap: 6px; padding: 0 6px; }
  .search { height: 40px; }
  .search input { font-size: 16px; }
  .side { position: fixed; top: var(--top-h); bottom: 0; left: 0; background: #fff; z-index: 40; transform: translateX(-100%); transition: transform .18s; box-shadow: 2px 0 12px rgba(0,0,0,.15); width: 270px; }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(0,0,0,.3); z-index: 35; }
  .main { margin: 0; border-radius: 0; }
  .row { height: auto; min-height: 64px; padding: 8px 12px 8px 4px; flex-wrap: wrap; align-items: flex-start; position: relative; }
  .r-ck { display: none; }
  .row .r-star { order: 5; position: absolute; right: 8px; bottom: 6px; }
  .r-who { width: auto; flex: 1; min-width: 0; padding-left: 8px; }
  .r-date { width: auto; }
  .r-main { flex-basis: 100%; white-space: normal; padding: 0 34px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .r-att { position: absolute; right: 40px; bottom: 8px; }
  .ck-all { display: none; }
  .thread { padding: 4px 12px 40px; }
  .t-subj { margin-left: 0; font-size: 19px; }
  .t-labels { margin-left: 0; }
  .msg-b { padding-left: 0; }
  .logout { font-size: 12px; }
}
