:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e6e9f0;
  --ink: #1e2530;
  --ink-soft: #3b4150;
  --muted: #8b93a3;
  --accent: #4f46e5;
  --accent-weak: #eef0fe;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
       color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }

/* Flash */
.flash { position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
         background: #fde2e1; color: #9b1c1c; padding: 8px 16px; border-radius: 8px; z-index: 60;
         box-shadow: var(--shadow); }

/* Login */
.login-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card { background: #fff; padding: 32px; border-radius: 14px; width: 330px;
              box-shadow: 0 10px 40px rgba(16,24,40,.10); }
.login-card h1 { margin: 0 0 4px; font-size: 21px; }
.login-card label { display: block; margin: 16px 0 0; font-size: 12px; color: #5b6472; }
.login-card input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line);
                    border-radius: 8px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.login-card button { width: 100%; margin-top: 22px; padding: 11px; border: 0; border-radius: 8px;
                     background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-card button:hover { background: #4338ca; }

/* App shell */
.app { display: flex; flex-direction: column; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 20px; padding: 0 18px; height: 56px;
          background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
a.brand { color: var(--ink); }
a.brand:hover .brand-mark { background: #4338ca; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
              background: var(--accent); color: #fff; border-radius: 8px; font-size: 12px; font-weight: 800;
              letter-spacing: .5px; }

/* Top-bar ticket search (order # / name / email) */
.ticket-search { margin-left: auto; display: flex; align-items: center; gap: 6px;
                 background: #fff; border: 1px solid var(--line); border-radius: 999px;
                 padding: 4px 10px; transition: border-color .12s, box-shadow .12s; }
.ticket-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.ticket-search .ts-icon { font-size: 12px; opacity: .6; line-height: 1; }
.ticket-search input[type=search] { border: none; outline: none; background: transparent; font: inherit;
                 font-size: 13px; color: var(--ink); width: 240px; max-width: 30vw; padding: 2px 0; }
.ticket-search input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.ticket-search .ts-clear { color: #94a3b8; text-decoration: none; font-size: 12px; line-height: 1;
                 padding: 2px 5px; border-radius: 6px; }
.ticket-search .ts-clear:hover { background: var(--accent-weak); color: var(--accent); }

/* Filter pills with counts */
.filters { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
        color: #5b6472; font-weight: 500; font-size: 13px; }
.pill:hover { background: #f0f2f7; }
.pill.active { background: var(--accent); color: #fff; }
.pill.pill-mine { color: var(--accent); }
.pill.pill-mine.active { color: #fff; }
.pill-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
              padding: 0 5px; border-radius: 999px; background: #eef0f5; color: #5b6472; font-size: 11px; font-weight: 700; }
.pill.active .pill-count { background: rgba(255,255,255,.25); color: #fff; }

/* Top-right user cluster: avatar · performance badge · account menu */
.user-cluster { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.perf-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px;
              background: #fff7e6; color: #b45309; border: 1px solid #fde9c8; font-size: 13px; font-weight: 700;
              line-height: 1; }
.perf-badge:hover { background: #fdeccd; border-color: #f6d488; color: #92400e; }
.perf-badge .perf-num { font-variant-numeric: tabular-nums; }

.who-menu { position: relative; }
.who-menu > summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none;
                      padding: 4px 8px; border-radius: 9px; }
.who-menu > summary::-webkit-details-marker { display: none; }
.who-menu > summary:hover { background: #f0f2f7; }
.who-name { color: var(--ink-soft); font-weight: 500; }
.who-caret { color: var(--muted); font-size: 11px; }
.who-dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line);
                border-radius: 10px; box-shadow: 0 8px 30px rgba(16,24,40,.14); min-width: 172px; padding: 6px; z-index: 40; }
.who-dropdown a { display: block; padding: 8px 12px; border-radius: 7px; color: var(--ink); font-size: 13px; }
.who-dropdown a:hover { background: var(--accent-weak); color: var(--accent); }

/* Account page */
.account-page { max-width: 620px; margin: 40px auto; padding: 0 20px; }
.account-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px;
                box-shadow: var(--shadow); }
.account-card h1 { font-size: 22px; margin: 8px 0 22px; }
.back { font-size: 13px; color: var(--muted); }
.back:hover { color: var(--accent); }
.acc-avatar-row { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.acc-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; font-size: 24px; flex: none; }
.acc-avatar-field { flex: 1; }
.fld-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin: 14px 0 6px; }
.account-card input[type=text] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.account-card input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.account-card input[type=file] { font: inherit; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.sig-preview { margin: 20px 0; border: 1px dashed var(--line); border-radius: 10px; padding: 14px; background: #fafbfc; }
.sig-preview-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; }
.sig-preview-body { white-space: pre-wrap; font-size: 13px; color: var(--ink-soft); }
.acc-actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; }

.three-pane { flex: 1; display: grid; grid-template-columns: 330px 1fr 340px; min-height: 0; }
.pane { overflow-y: auto; min-height: 0; }
.pane.list { border-right: 1px solid var(--line); background: var(--panel); padding: 0; }
.pane.convo { padding: 20px 24px; display: flex; flex-direction: column; }
.pane.sidebar { border-left: 1px solid var(--line); background: var(--bg); padding: 14px; }

/* Avatars */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
          border-radius: 50%; font-size: 13px; font-weight: 700; flex: none; }
img.avatar { object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.agent-av { background: var(--accent); color: #fff; }
.a-0 { background: #e0e7ff; color: #4338ca; }
.a-1 { background: #dcfce7; color: #15803d; }
.a-2 { background: #ffe4e6; color: #be123c; }
.a-3 { background: #fef3c7; color: #b45309; }
.a-4 { background: #cffafe; color: #0e7490; }
.a-5 { background: #fae8ff; color: #a21caf; }

/* Ticket list */
.list-head { position: sticky; top: 0; z-index: 1; background: var(--panel); display: flex; align-items: center;
             gap: 8px; padding: 14px 16px; font-weight: 700; font-size: 13px; text-transform: uppercase;
             letter-spacing: .4px; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.list-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px;
              padding: 0 6px; border-radius: 999px; background: #eef0f5; color: #5b6472; font-size: 11px; }
.ticket-row { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid #f0f2f6; color: inherit;
              border-left: 3px solid transparent; }
.ticket-row:hover { background: #f7f8fb; }
.ticket-row.sel { background: var(--accent-weak); border-left-color: var(--accent); }
.row-main { min-width: 0; flex: 1; }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row-top .cust { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-top .when { color: var(--muted); font-size: 12px; flex: none; }
.subj { color: var(--ink-soft); margin: 2px 0 6px; font-size: 13px; white-space: nowrap; overflow: hidden;
        text-overflow: ellipsis; }
.row-badges { display: flex; gap: 5px; flex-wrap: wrap; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 8px;
         border-radius: 6px; font-weight: 600; white-space: nowrap; }
.badge.intent { background: #f1f3f8; color: #5b6472; text-transform: capitalize; }
.badge.who-chip { background: #eef0f5; color: #5b6472; }
.badge.who-chip.me { background: var(--accent-weak); color: var(--accent); }
.badge.who-chip.closed-by { background: #e7f3ec; color: #2e7d52; }
.badge.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.dot { text-transform: capitalize; }
.badge.big { font-size: 12px; padding: 4px 11px; }
.s-open { background: #e7f8ee; color: #15803d; }
.s-pending { background: #fef6e0; color: #b45309; }
.s-closed { background: #eef0f3; color: #5b6472; }
.s-snoozed { background: #e9ecff; color: #4338ca; }
.s-other { background: #f7e9ff; color: #9333ea; }

/* Conversation */
.convo-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 16px;
              border-bottom: 1px solid var(--line); }
.convo-head-main { min-width: 0; flex: 1; }
.convo-head h2 { font-size: 17px; margin: 0; }
.convo-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.bubble-row { display: flex; align-items: flex-end; gap: 9px; }
.bubble-row.outbound { justify-content: flex-end; }
.bubble-row.note { justify-content: center; }
.bubble { max-width: 78%; border-radius: 14px; padding: 10px 14px; border: 1px solid var(--line);
          background: #fff; box-shadow: var(--shadow); }
.bubble.inbound { max-width: 84%; border-bottom-left-radius: 4px; }
.bubble.outbound { max-width: 78%; background: var(--accent); color: #fff; border-color: var(--accent);
                   border-bottom-right-radius: 4px; }
.bubble.note { background: #fffbeb; border-color: #fde68a; max-width: 88%; }
.bubble-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; font-size: 12px; }
.bubble-head strong { font-weight: 600; }
.bubble.outbound .bubble-head { color: rgba(255,255,255,.92); }
.bubble-time { opacity: .65; font-size: 11px; }
.bubble-body { white-space: pre-wrap; word-wrap: break-word; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.att-img { cursor: zoom-in; }
.att-img img { width: 116px; height: 116px; object-fit: cover; border-radius: 10px;
               border: 1px solid var(--line); display: block; background: #f4f5f7; }
.att-img:hover img { border-color: var(--accent); }
.att-file { font-size: 13px; }
.bubble.outbound .att-file { color: #fff; text-decoration: underline; }

/* Inline audio / video players (e.g. phone-call recordings) */
.att-media { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.att-player { width: 100%; max-width: 340px; }
.att-audio { height: 38px; }
.att-video { max-height: 220px; border-radius: 10px; background: #000; }
.att-dl { font-size: 12px; color: var(--accent); text-decoration: none; }
.att-dl:hover { text-decoration: underline; }
.bubble.outbound .att-dl { color: #fff; }

/* Composer */
.composer { position: relative; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.composer-head { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.composer-head .src { font-weight: 500; color: var(--accent); font-size: 12px; margin-left: 6px;
                      background: var(--accent-weak); padding: 2px 8px; border-radius: 6px; }
.composer textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
                     font: inherit; resize: vertical; background: #fff; }
.composer textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.composer-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

/* Canned replies admin page */
.canned-admin { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.canned-top h1 { margin: 10px 0 4px; font-size: 22px; }
.canned-intro { color: var(--ink-soft, #6b7280); font-size: 14px; margin: 0 0 18px; }
.canned-intro code, .preview-hint code { background: var(--accent-weak); color: var(--accent);
              padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.canned-card { background: #fff; border: 1px solid var(--line); border-radius: 12px;
              padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.canned-card h2 { margin: 0 0 12px; font-size: 15px; }
.canned-new { background: #fafbff; }
.canned-list > h2 { margin: 26px 0 12px; font-size: 14px; color: var(--ink-soft, #6b7280); }
.canned-row { display: flex; gap: 14px; }
.canned-row label { flex: 1; }
.canned-card label { display: block; font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 10px; }
.canned-card .hint { font-weight: 400; color: #9ca3af; }
.canned-card input[type=text], .canned-card textarea { width: 100%; margin-top: 5px; padding: 9px 11px;
              border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; }
.canned-card input[type=text]:focus, .canned-card textarea:focus { outline: none;
              border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.canned-card textarea { resize: vertical; }
.canned-actions { display: flex; align-items: center; gap: 10px; }
.preview-hint { margin-left: auto; font-size: 12px; }

/* Canned-reply slash menu (type / in the composer) */
.canned-menu { position: absolute; z-index: 30; max-height: 230px; overflow-y: auto;
               background: #fff; border: 1px solid var(--line); border-radius: 10px;
               box-shadow: 0 8px 24px rgba(16,24,40,.14); padding: 4px; }
.canned-item { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px;
               border-radius: 7px; cursor: pointer; }
.canned-item.active { background: var(--accent-weak); }
.canned-item .ci-slug { color: var(--accent); font-weight: 700; font-size: 12.5px;
               font-family: ui-monospace, Menlo, Consolas, monospace; flex: none; min-width: 92px; }
.canned-item .ci-label { color: var(--ink); font-size: 13px; }

/* Order panel: header + refresh button */
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-refresh { border: 1px solid var(--line); background: #fff; color: #475569; cursor: pointer;
                 border-radius: 7px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.order-refresh:hover { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
.order-refresh:disabled { opacity: .6; cursor: default; }
.order-refreshed { margin-left: 8px; color: #15803d; font-size: 12px; font-weight: 600;
                   animation: cannedFade 2.6s forwards; }
@keyframes cannedFade { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
.btn { padding: 9px 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
       font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f3f4f8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #4338ca; }
.send-note { font-size: 12px; }

/* Sidebar cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
        margin-bottom: 12px; box-shadow: var(--shadow); }
.card h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
           margin: 0 0 10px; }
.card h3 + h3, .card .product + h3, .card .kv + h3 { margin-top: 16px; }
.card h3 .src { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--accent); font-size: 11px; }
.kv { display: flex; gap: 10px; padding: 4px 0; font-size: 13px; }
.kv span:first-child { width: 86px; color: var(--muted); flex: none; }
.kv .kv-val, .kv .track, .kv .addr { word-break: break-word; }
.kv .cat { color: var(--accent); font-weight: 600; }

/* Order panel */
.product { padding: 9px 0; border-bottom: 1px solid #f0f2f6; }
.product:last-of-type { border-bottom: 0; }
.p-name { font-size: 13px; font-weight: 600; }
.p-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.p-status { color: #b45309; }
.refunded { color: #be123c; font-weight: 600; }
.no-order { font-size: 13px; padding: 2px 0 8px; }
.find-order { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--accent-weak);
              color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; }
.find-order:hover { background: #e2e6fd; }
.find-order:disabled { opacity: .6; cursor: default; }

.inline-form { display: flex; gap: 6px; margin-top: 8px; }
.inline-form select { flex: 1; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
                      font: inherit; }
.inline-form button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
                      color: var(--accent); font-weight: 600; cursor: pointer; }
.inline-form button:hover { background: var(--accent-weak); }
.assign-form { margin-top: 8px; }
.assign-form .inline-form { margin-top: 0; }
.assign-note { width: 100%; margin-top: 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px;
               font: inherit; font-size: 13px; }
.assign-note:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.trash-form { margin-top: 10px; }
.btn-trash { width: 100%; padding: 8px 12px; border: 1px solid #f3c4c4; border-radius: 8px;
             background: #fef2f2; color: #b91c1c; font-weight: 600; font-size: 13px; cursor: pointer; }
.btn-trash:hover { background: #fde2e2; border-color: #ef9a9a; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty.big { margin: auto; }
.empty-icon { font-size: 30px; margin-bottom: 8px; }

/* Performance / metrics page */
.m-back { margin-left: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.m-back:hover { color: var(--accent); }
.m-ranges { margin-left: 12px; }
.metrics-page { flex: 1; overflow-y: auto; padding: 24px 28px 40px; max-width: 1040px; margin: 0 auto; width: 100%; }

.m-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.m-hero-text { min-width: 0; }
.m-hero h1 { font-size: 22px; margin: 0 0 4px; }
.m-hero-sub { margin: 0; color: var(--muted); font-size: 13px; max-width: 540px; }

/* Encouraging animated mascot to the left of the avatar */
.encourage-anim { font-size: 38px; line-height: 1; flex: none; animation: ez-bob 1.8s ease-in-out infinite;
                  transform-origin: 50% 80%; }
.encourage-anim.lead { animation: ez-pop 1.1s ease-in-out infinite; filter: drop-shadow(0 3px 6px rgba(245,158,11,.4)); }
@keyframes ez-bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-7px) rotate(4deg); } }
@keyframes ez-pop { 0%,100% { transform: scale(1) rotate(-6deg); } 50% { transform: scale(1.18) rotate(6deg); } }

/* "You're leading / ranked #X" callout */
.m-standing { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
              background: #eef0fe; border: 1px solid #dfe2fb; border-radius: 999px; padding: 4px 12px; }
.m-standing.lead { color: #92400e; background: #fff5e0; border-color: #f6d488;
                   animation: ez-glow 2s ease-in-out infinite; }
@keyframes ez-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.0); }
                     50% { box-shadow: 0 0 0 4px rgba(245,158,11,.18); } }

/* Performance badge — leader state */
.perf-badge.leading { background: #fff3d6; border-color: #f6cf72; color: #92400e;
                      animation: ez-glow 2s ease-in-out infinite; }

/* Celebration toast */
.ez-toast { position: fixed; left: 50%; top: 76px; transform: translate(-50%, -14px); z-index: 10000;
            background: #111827; color: #fff; font-weight: 700; font-size: 15px; padding: 11px 20px;
            border-radius: 999px; box-shadow: 0 12px 40px rgba(0,0,0,.3); opacity: 0;
            transition: opacity .35s ease, transform .35s ease; }
.ez-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ez-toast-main { font-weight: 700; }
.ez-toast-sub { font-weight: 500; font-size: 12px; opacity: .75; margin-top: 2px; }
/* Calmer mood-lifter variant (CSR on a nasty ticket) — soft teal, not the dark
   celebration pill. */
.ez-toast-morale { background: #0f766e; font-weight: 600; }
/* Warm "thank you from Team EZ" variant — gold gradient, a little wider for the
   note + signature. */
.ez-toast-thanks { background: linear-gradient(135deg, #b45309, #d97706); max-width: 360px;
  text-align: center; }
.ez-toast-thanks .ez-toast-sub { opacity: .85; }

.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.m-tile { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line);
          border-radius: 12px; padding: 15px 16px; box-shadow: var(--shadow); }
.m-tile.good { border-left-color: #22c55e; }
.m-tile.warn { border-left-color: #f59e0b; }
.m-tile.bad  { border-left-color: #ef4444; }
.m-tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
                font-weight: 700; display: flex; align-items: center; gap: 6px; }
.m-check { color: #16a34a; }
.m-tile-value { font-size: 30px; font-weight: 800; color: var(--ink); margin: 6px 0 2px; line-height: 1.1; }
.m-tile.good .m-tile-value { color: #15803d; }
.m-tile.bad  .m-tile-value { color: #b91c1c; }
.m-tile-sub { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-tile-hint { font-size: 11px; color: var(--muted); margin-top: 8px; }

.m-board { margin-top: 30px; }
.m-board h2 { font-size: 16px; margin: 0 0 12px; }
.m-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line);
           border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.m-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
              color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.m-table td { padding: 11px 12px; border-bottom: 1px solid #f0f2f6; font-size: 13px; }
.m-table tr:last-child td { border-bottom: 0; }
.m-table tr.me { background: var(--accent-weak); }
.m-table tr.m-row { cursor: pointer; }
.m-table tr.m-row:hover { background: #f3f6ff; }
.m-table tr.m-row.me:hover { background: #e4e8fd; }
.m-csr a { color: inherit; font-weight: 600; }
.m-csr a:hover { color: var(--accent); }
.m-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.m-table .num.strong { font-weight: 800; }
.m-table .num.good { color: #15803d; }
.m-table .num.warn { color: #b45309; }
.m-table .num.bad  { color: #b91c1c; }
.m-rank { width: 34px; text-align: center; font-weight: 700; color: var(--ink-soft); }
.m-csr { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.m-you { font-size: 10px; font-weight: 700; color: var(--accent); background: #fff; border: 1px solid var(--accent);
         border-radius: 5px; padding: 1px 5px; text-transform: uppercase; letter-spacing: .3px; }
.m-foot { margin-top: 26px; font-size: 12px; color: var(--muted); line-height: 1.6; max-width: 760px; }

/* Image lightbox */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.86);
      display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb-img { max-width: 88vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 12px 50px rgba(0,0,0,.5); }
.lb-close, .lb-prev, .lb-next { position: absolute; border: 0; cursor: pointer; color: #fff;
      background: rgba(255,255,255,.14); border-radius: 999px; line-height: 1; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.3); }
.lb-close { top: 18px; right: 22px; width: 42px; height: 42px; font-size: 24px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 56px; height: 56px; font-size: 34px; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-caption { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
      color: #fff; font-size: 13px; opacity: .85; }
.lb-counter { position: absolute; top: 22px; left: 24px; color: #fff; font-size: 13px; opacity: .7; }
