/* MāramaEdu AutoMail v1.2 */
*{box-sizing:border-box}
:root{
  --ink:#17233b;
  --muted:#64748b;
  --line:#dce5ef;
  --bg:#eef4f8;
  --brand:#126c78;
  --brand2:#244f73;
  --white:#fff;
  --danger:#b42318;
}
html{min-height:100%}
body{
  margin:0;
  min-height:100vh;
  background:linear-gradient(180deg,#edf5f8 0,#f7fafc 100%);
  color:var(--ink);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
a{color:inherit}
.topbar{
  min-height:64px;
  background:#fff;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:18px;
  padding:0 24px;
  position:sticky;
  top:0;
  z-index:20;
  box-shadow:0 4px 18px rgba(27,53,82,.05);
}
.brand{
  font-weight:900;
  color:var(--brand);
  text-decoration:none;
  font-size:1.15rem
}
.topbar>strong{flex:1}
.top-actions{display:flex;gap:14px}
.top-actions a{text-decoration:none;color:#52647a;font-weight:700}
.shell{
  width:min(1180px,calc(100% - 28px));
  margin:28px auto
}
.panel{
  background:#fff;
  border-radius:22px;
  padding:28px;
  box-shadow:0 18px 60px rgba(27,53,82,.10)
}
.panel.narrow{
  width:min(560px,100%);
  margin:7vh auto
}
.eyebrow{
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:.76rem;
  font-weight:900;
  color:var(--brand);
  margin:0 0 8px
}
h1{margin:0 0 14px;font-size:clamp(1.7rem,4vw,2.6rem)}
.stack{display:grid;gap:14px;margin-top:22px}
label{display:grid;gap:7px;font-weight:800}
input{
  width:100%;
  padding:13px;
  border:1px solid #b8c6d5;
  border-radius:11px;
  font:inherit;
  background:#fff
}
button,.external{
  border:0;
  border-radius:12px;
  padding:13px 18px;
  background:var(--brand);
  color:#fff;
  font:inherit;
  font-weight:850;
  cursor:pointer;
  text-decoration:none;
  text-align:center
}
button:hover,.external:hover{filter:brightness(.97)}
.secondary{
  background:#edf3f7;
  color:#274057;
  border:1px solid #d6e1ea
}
.full{width:100%;display:block;margin-top:10px}
.alert{
  padding:14px 16px;
  background:#eff8ff;
  border-radius:12px;
  margin-bottom:16px
}
.alert.error{background:#fff1f0;color:var(--danger)}
.choice-grid{display:grid;gap:18px;margin-top:24px}
.choice-grid.two{grid-template-columns:1fr 1fr}
.choice{
  width:100%;
  min-height:180px;
  display:grid;
  place-items:center;
  gap:6px;
  border-radius:20px
}
.choice span{
  display:grid;
  place-items:center;
  width:64px;
  height:64px;
  border-radius:50%;
  background:rgba(255,255,255,.15);
  font-size:2rem;
  font-weight:950
}
.choice strong{font-size:1.5rem}
.choice small{opacity:.85}
.choice.teb{background:var(--brand2)}
.section-head,.inbox-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px
}
.number-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin-top:22px
}
.number{
  width:100%;
  min-height:112px;
  background:#f7fafc;
  color:var(--ink);
  border:1px solid var(--line);
  display:grid;
  place-items:center;
  gap:5px
}
.number:hover{
  border-color:#76a9b0;
  background:#f0fafa
}
.number strong{font-size:1.8rem;color:var(--brand)}
.number small{font-size:.78rem;color:var(--muted)}
.mail-shell{
  display:grid;
  grid-template-columns:270px minmax(0,1fr);
  gap:18px
}
.sidebar,.mail-main{
  background:#fff;
  border-radius:20px;
  box-shadow:0 14px 50px rgba(27,53,82,.08)
}
.sidebar{
  padding:18px;
  align-self:start;
  position:sticky;
  top:82px
}
.mail-main{padding:24px;min-height:520px}
.mail-id{
  display:flex;
  align-items:center;
  gap:12px;
  padding-bottom:16px;
  border-bottom:1px solid var(--line);
  margin-bottom:12px
}
.mail-id small{
  display:block;
  color:var(--muted);
  margin-top:3px;
  word-break:break-all
}
.avatar{
  width:48px;
  height:48px;
  flex:0 0 48px;
  border-radius:14px;
  background:var(--brand);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:950;
  font-size:1.25rem
}
.external{background:var(--brand2)}
.autodesk{background:#2f4050}
.hint,.readonly{
  font-size:.82rem;
  line-height:1.45;
  color:var(--muted)
}
.readonly{
  padding:10px;
  background:#f8fafc;
  border-radius:10px
}
.inbox-head{
  padding-bottom:18px;
  border-bottom:1px solid var(--line)
}
.inbox-head h1{font-size:1.45rem;margin:0}
.inbox-head>span{color:var(--muted)}
.message-list{display:grid}
.message-row{
  display:grid;
  grid-template-columns:minmax(160px,1fr) minmax(220px,2fr) 190px;
  gap:16px;
  padding:15px 8px;
  border-bottom:1px solid #edf1f5;
  text-decoration:none;
  align-items:center
}
.message-row:hover{background:#f8fafc}
.message-row.unread{font-weight:800}
.message-row .from,.message-row .subject{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.message-row .date{
  color:var(--muted);
  font-size:.86rem;
  text-align:right
}
.empty{
  padding:38px 20px;
  text-align:center;
  color:var(--muted)
}
.message-toolbar{margin-bottom:16px}
.message-toolbar a{
  text-decoration:none;
  color:var(--brand);
  font-weight:800
}
.message h1{font-size:1.7rem}
.meta{
  background:#f8fafc;
  border-radius:12px;
  padding:12px;
  line-height:1.6;
  color:#465a70
}
.message-body{
  margin-top:20px;
  overflow-wrap:anywhere;
  line-height:1.55
}
.message-body img{max-width:100%;height:auto}
.message-body table{max-width:100%}
.plain{white-space:pre-wrap}
@media(max-width:850px){
  .number-grid{grid-template-columns:repeat(2,1fr)}
  .mail-shell{grid-template-columns:1fr}
  .sidebar{position:static}
  .message-row{grid-template-columns:1fr}
  .message-row .date{text-align:left}
  .choice-grid.two{grid-template-columns:1fr}
}
@media(max-width:480px){
  .topbar{padding:0 12px}
  .topbar>strong{display:none}
  .shell{width:min(100% - 16px,1180px);margin:16px auto}
  .panel,.mail-main{padding:18px}
  .number-grid{gap:9px}
  .number{min-height:96px}
  .number small{font-size:.68rem}
}