@import url('/matsugram-document.css');

.app-choices:has(.matsugram-choice){grid-template-columns:repeat(3,minmax(0,1fr));max-width:900px;gap:18px}
.matsugram-choice .choice-symbol{color:#44755d;background:#e7efe8}
.matsugram-choice:hover:enabled,.matsugram-choice.current-app{border-color:#608d72}
.matsugram{--mg-green:#39775a;--mg-pale:#edf5ef;--mg-line:#dfe7df;max-width:1560px;margin:0 auto;padding:0 28px 24px;color:#263c33}
.mg-shell{height:calc(100svh - 124px);min-height:440px;display:flex;flex-direction:column;gap:0}
.mg-header{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid var(--mg-line);padding:16px 0;flex-shrink:0}
.mg-title{display:flex;align-items:center;gap:12px;min-width:0}
.mg-title h1{font-size:24px;letter-spacing:1.5px;white-space:nowrap;margin:0}
.mg-mark{display:grid;place-items:center;width:37px;height:37px;background:var(--mg-green);color:#fff;border-radius:11px;font-size:24px;flex-shrink:0}
.mg-phase{font-size:11px;color:#60766a;background:#edf0e8;border-radius:20px;padding:5px 10px;white-space:nowrap}
[data-phase="voting"] .mg-phase{background:#fff0d8;color:#8d6a25}
.mg-save{font-size:11px;color:#7a877b;white-space:nowrap}
.mg-tabs{display:flex;gap:6px;border-bottom:1px solid var(--mg-line);margin-bottom:18px;flex-shrink:0}
.mg-tabs button{position:relative;min-width:110px;padding:12px 25px 14px;background:none;border:0;font-size:13px;color:#7b887e;font-weight:700}
.mg-tabs button.active{color:var(--mg-green)}
.mg-tabs button.active:after{content:'';position:absolute;height:3px;background:var(--mg-green);bottom:-1px;left:16px;right:16px;border-radius:5px}
.mg-pane{flex:1;min-height:0;display:flex;flex-direction:column}
.mg-button{min-height:42px;display:inline-flex;align-items:center;justify-content:center;gap:9px;border:1px solid #d8e1d7;border-radius:10px;background:white;padding:9px 17px;font-size:12px;font-weight:700;white-space:nowrap}
.mg-button:hover:enabled{background:#f1f6f0}
.mg-like svg,.mg-button svg,.mg-result-likes svg{width:21px;height:21px;flex-shrink:0}
.mg-reopen{min-height:36px;padding:5px 12px;font-size:11px}
.mg-primary{background:var(--mg-green);border-color:var(--mg-green);color:#fff}
.mg-primary:hover:enabled{background:#2d654a}
.mg-end{border-color:#e5c9ac;background:#fff5e9;color:#89623a}
.mg-offline{background:#fff1d9;border:1px solid #ebd7b1;color:#7f632a;padding:9px 14px;font-size:11px;border-radius:8px;margin-bottom:10px;flex-shrink:0}
.mg-writing-bar{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#7b887e;max-width:700px;width:100%;margin:0 auto 9px;flex-shrink:0}
.mg-count{font-family:system-ui;font-size:11px;letter-spacing:.4px}
.mg-document-scroll{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;min-height:0;background:#ebece5;border:1px solid var(--mg-line);border-radius:12px}
.mg-writing-scroll{flex:1;width:100%;padding:18px 22px}
.mg-writing-scroll .mg-document{max-width:700px}
.matsugram .mg-document-answer{scrollbar-width:thin}
.matsugram textarea.mg-document-answer{min-height:90px;resize:vertical}
.matsugram textarea.mg-document-answer[readonly]{resize:none}
.mg-section-bar{display:flex;align-items:center;justify-content:space-between;margin:1px 0 17px;flex-shrink:0}
.mg-section-bar h2,.mg-answer-heading h2,.mg-results-top h2{font-size:16px;font-weight:700;margin:0}
.mg-roster-count{font:600 12px system-ui;color:#748579}
.mg-monitor-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px;overflow:auto;align-content:start;padding:2px 4px 20px;scrollbar-width:thin}
.mg-student-tile{display:flex;flex-direction:column;text-align:left;min-height:169px;border:1px solid #dde5d9;background:#fff;border-radius:14px;padding:14px;box-shadow:0 4px 10px #2b423b04;transition:transform .15s,border-color .15s}
.mg-student-tile:hover{transform:translateY(-2px);border-color:#7da58a}
.mg-tile-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.mg-tile-top strong{font-size:11px;letter-spacing:.4px;font-weight:600}
.mg-online-dot{height:7px;width:7px;border-radius:50%;background:#c8cec6}
.mg-online-dot.online{background:#6a9d7c;box-shadow:0 0 0 3px #6a9d7c12}
.mg-tile-preview{font:400 13px/1.8 'BIZ UDPGothic','BIZ UDPゴシック',sans-serif;color:#536157;background:#f8faf6;border:1px solid #eef1e9;border-radius:5px;padding:10px 11px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;min-height:85px;overflow-wrap:anywhere;white-space:pre-wrap}
.mg-tile-bottom{margin-top:10px;text-align:right;color:#849083;font-size:10px}
.mg-tile-bottom{display:flex;align-items:center;justify-content:flex-end;gap:10px}
.mg-report-chip{color:#4c7556;background:#edf4e8;border-radius:5px;padding:4px 7px;font-size:9px}
.mg-demo-start{margin-top:9px;color:#6f8765;background:#f3f7ed;border-color:#d9e3cf}
.mg-demo-bar{display:flex;align-items:center;justify-content:space-between;gap:15px;border:1px solid #e3ddc9;background:#f7f3e7;border-radius:10px;padding:10px 13px;margin:0 0 14px;flex-shrink:0}
.mg-demo-bar>span{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.mg-demo-bar strong{font-size:11px;font-weight:600;color:#8a7953}
.mg-demo-status{font-size:10px;color:#a09270}
.mg-demo-bar .mg-button{font-size:10px;min-height:32px;background:#fffdf7;color:#927f56;border-color:#e3dcc9;padding:7px 10px}
.mg-empty{font-size:13px;text-align:center;padding:40px 15px;color:#899487;line-height:1.8}
body.matsugram-inspecting{overflow:hidden}
body.matsugram-inspecting>.site-header{display:none}
.matsugram.mg-inspecting{max-width:none;margin:0;padding:0}
.mg-monitor-view{width:100%;height:100svh;min-height:0;background:#f6f7f1;color:#263c33;overflow:hidden}
.mg-monitor-view:not([hidden]){display:flex;flex-direction:column}
.mg-monitor-back{flex-shrink:0;font-size:13px;min-height:44px;background:#fff}
.mg-monitor-view>header{display:flex;align-items:center;gap:15px;min-height:60px;padding:12px 20px;border-bottom:1px solid var(--mg-line);flex-shrink:0}
.mg-monitor-name{font-size:14px}.mg-monitor-status{font-size:10px;color:#7b887e}
.mg-icon-button{margin-left:auto;display:grid;place-items:center;width:34px;height:34px;border:1px solid #d9e0d6;border-radius:50%;font:24px/1 system-ui;background:white}
.mg-monitor-screen{flex:1;min-height:0;overflow:auto;padding:20px 30px;scrollbar-width:thin}
.mg-monitor-screen .mg-document{max-width:700px}
.mg-monitor-screen.mg-monitor-voting{display:flex;flex-direction:column;overflow:hidden;padding:14px}
.mg-monitor-screen.mg-monitor-voting>.mg-voting-layout{width:100%}
.mg-monitor-screen .mg-personal-feedback{max-height:none;overflow:visible}
.mg-monitor-screen.mg-monitor-report{pointer-events:auto}
.mg-monitor-viewbar{display:flex;gap:5px;padding:8px 20px;border-bottom:1px solid var(--mg-line);flex-shrink:0}
.mg-monitor-viewbar button{border:0;border-radius:7px;background:transparent;font-size:11px;padding:7px 15px;color:#8a9682}
.mg-monitor-viewbar button.active{background:#e5eee0;color:#4b7453;font-weight:600}
.mg-remote-focus{box-shadow:inset 0 0 0 2px #397c5d!important;background:#f7fcf8!important}
.mg-voting-controls{display:flex;justify-content:space-between;align-items:center;gap:18px;min-height:47px;margin-bottom:13px;font-size:12px;color:#718072;flex-shrink:0}
.mg-voting-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:22px;flex:1;min-height:0}
.mg-voting-document{padding:13px}
.mg-answer-section{display:flex;flex-direction:column;min-height:0;min-width:0}
.mg-answer-heading{display:flex;align-items:center;justify-content:space-between;padding:7px 4px 15px;flex-shrink:0}
.mg-vote-count{font:700 15px system-ui;color:var(--mg-green);background:#e5eee3;border-radius:20px;padding:6px 12px}
.mg-answer-list{overflow:auto;min-height:0;flex:1;scrollbar-width:thin;padding:0 4px 10px}
.mg-answer-strip{display:flex;align-items:center;gap:14px;position:relative;border:1px solid #dce3d7;border-radius:9px;background:white;padding:15px 13px 15px 17px;margin-bottom:12px;min-height:115px;transition:border-color .15s,background .15s}
.mg-answer-strip.selected{background:#f0f7ee;border-color:#7da886;box-shadow:inset 3px 0 0 #6f9e79}
.mg-strip-body{flex:1;min-width:0}
.mg-anonymous-label{display:block;font-size:10px;font-weight:500;color:#899085;line-height:1.7}
.mg-anonymous-label strong{display:inline-block;margin-left:8px;color:#4b6a55;font-weight:700;background:#e9f0e5;border-radius:4px;padding:1px 6px}
.mg-strip-body p,.mg-result-text{font:400 18px/1.85 'BIZ UDPGothic','BIZ UDPゴシック',sans-serif;color:#263c33;margin:9px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.mg-like{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-width:57px;min-height:65px;background:#f7f9f4;border:1px solid #e3e9df;border-radius:11px;color:#a1ac9c;flex-shrink:0;font-size:9px;white-space:nowrap}
.mg-like:hover:enabled{border-color:#7da886;color:var(--mg-green)}
.mg-like[aria-pressed="true"]{background:var(--mg-green);border-color:var(--mg-green);color:white}
.mg-like[aria-pressed="true"] svg{fill:#ffffff22}
.mg-like:disabled{opacity:.65}
[data-phase="results"] .mg-like[aria-pressed="true"]{background:var(--mg-pale);color:var(--mg-green);opacity:1}
[data-phase="results"] .mg-like[aria-pressed="true"] svg{fill:currentColor}
.mg-live-count{display:flex;gap:8px;align-items:center;color:#5c7963}
.mg-live-count i{display:block;width:6px;height:6px;border-radius:50%;background:#6c9d73;box-shadow:0 0 0 4px #6c9d7314}
.mg-results-top{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0 0 13px;flex-shrink:0}
.mg-revealed{color:#7b887e;font-size:11px}
.mg-result-tabs{display:flex;gap:5px;margin-bottom:15px;background:#ecefe7;align-self:flex-start;padding:4px;border-radius:11px;flex-shrink:0}
.mg-result-tabs button{min-height:36px;border:0;background:none;border-radius:8px;padding:8px 20px;font-size:12px;font-weight:700;color:#83907c}
.mg-result-tabs button.active{background:white;box-shadow:0 1px 4px #00000007;color:#39775a}
.mg-result-content{display:flex;flex-direction:column;flex:1;min-height:0}
.mg-results-list{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;padding:0 5px 8px 0}
.mg-result-card{display:flex;align-items:center;gap:24px;min-height:123px;background:white;border:1px solid #e0e5d9;border-radius:12px;padding:20px 24px;margin-bottom:12px}
.mg-result-card>div{flex:1;min-width:0}
.mg-rank{display:block;min-width:46px;text-align:center;font:700 28px system-ui;color:#adb6a6;flex-shrink:0}
.mg-rank small{font-size:10px;margin-left:3px}
.mg-rank-top{color:#9b8347}
.mg-result-likes{display:flex;align-items:center;gap:9px;font:700 22px system-ui;color:#5d8664;margin-left:15px;flex-shrink:0}
.mg-result-likes svg{width:22px}
.mg-result-likes.mg-voted svg{fill:var(--mg-green);stroke:var(--mg-green)}
.mg-ai-launch{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:17px 10px 3px;flex-shrink:0}
.mg-ai-button{min-width:310px;min-height:61px;padding:16px 30px;background:#314f3b;color:white;border-color:#314f3b;border-radius:14px;letter-spacing:1px;font-size:18px;font-weight:600;box-shadow:0 5px 0 #23392b}
.mg-ai-button:hover:enabled{background:#243e2d}
.mg-ai-button:disabled{background:#e4e8de;color:#8d9886;border-color:#dce2d3;box-shadow:0 4px 0 #d8ddcf}
.mg-ai-status{font-size:11px;color:#8b9683;min-height:17px;text-align:center}
.mg-ai-heading{display:flex;gap:13px;align-items:center;margin:2px 0 19px}
.mg-ai-heading>span{font-size:32px;color:#8ca579}
.mg-ai-heading h3{font-size:16px;margin:0 0 5px}
.mg-ai-heading small,.mg-model-label{color:#9aa392;font:10px system-ui;letter-spacing:.5px}
.mg-ai-card{align-items:flex-start}
.mg-ai-reason{border-top:1px solid #edf0e7;margin:16px 0 0;padding:13px 0 0;font-size:12px;line-height:1.95;color:#71806b;white-space:pre-wrap}
.mg-feedback-details{margin-top:13px;color:#73826c;font-size:11px}
.mg-feedback-details summary,.mg-teacher-feedback summary{cursor:pointer;font-size:11px;color:#5b785c;padding:8px 0}
.mg-teacher-feedback{padding:5px 20px;max-height:34vh;overflow:auto;border:1px solid #e0e5d9;border-radius:10px;background:#f6f8f0;margin-top:10px;flex-shrink:0}
.mg-feedback-top{display:flex;align-items:center;justify-content:space-between;gap:15px;max-width:850px;width:100%;margin:5px auto 23px;flex-shrink:0}
.mg-feedback-top h2{font-size:24px;margin:9px 0 0;letter-spacing:1px}
.mg-ai-kicker{font-size:11px;letter-spacing:1px;color:#7e9570}
.mg-personal-feedback{max-width:850px;width:100%;margin:0 auto;background:white;border:1px solid #dde5d5;border-radius:15px;padding:32px 38px;overflow:auto;scrollbar-width:thin}
.mg-personal-feedback blockquote{font:400 19px/1.9 'BIZ UDPGothic','BIZ UDPゴシック',sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 27px;padding:17px 20px;background:#f4f7ef;border-left:3px solid #a0b48d;border-radius:0 7px 7px 0}
.mg-feedback{font-size:13px;line-height:2.05;color:#65735f;overflow-wrap:anywhere}
.mg-feedback p{white-space:pre-wrap}
.mg-feedback h3{font-size:13px;color:#395e3e;margin:24px 0 7px}
.mg-feedback ul{padding-left:1.4em;margin:6px 0 0}
.mg-feedback li{padding:3px 0}
.mg-feedback-summary{font-size:14px;margin:0}
.mg-revision{border:1px solid #e7ebdf;border-radius:8px;padding:13px 17px;background:#fafbf7;margin:8px 0 20px}
@media(max-width:620px){.mg-demo-bar{padding:9px 10px;margin-bottom:11px;gap:10px}.mg-demo-bar>span{gap:5px;flex-direction:column;align-items:flex-start}.mg-demo-bar strong{font-size:10px}.mg-demo-status{font-size:9px;line-height:1.6}.mg-demo-bar .mg-button{font-size:9px;min-height:31px;padding:6px 8px}.mg-report-chip{font-size:8px;padding:3px 5px}.mg-tile-bottom{gap:5px;flex-wrap:wrap;justify-content:space-between}.mg-monitor-viewbar{padding:7px 13px}.mg-monitor-viewbar button{font-size:10px}}
@media(min-width:741px) and (max-height:720px){.mg-shell{height:calc(100svh - 95px)}.mg-header{padding:10px 0}.mg-tabs{margin-bottom:11px}.mg-tabs button{padding-top:9px;padding-bottom:11px}}
@media(max-width:900px){.matsugram{padding-left:18px;padding-right:18px}.mg-voting-layout{gap:14px}.mg-answer-strip{padding:13px 10px 13px 13px;gap:10px}.mg-strip-body p{font-size:15px}.mg-like{min-width:48px}.mg-result-card{padding:18px;gap:15px}.app-choices:has(.matsugram-choice){gap:13px}.app-choices:has(.matsugram-choice) .app-choice strong{font-size:18px}}
@media(max-width:620px){.app-choices:has(.matsugram-choice){grid-template-columns:1fr;max-width:390px;gap:12px}.app-choices:has(.matsugram-choice) .app-choice{aspect-ratio:auto;min-height:102px;padding:18px 22px;display:grid;grid-template-columns:54px 1fr;grid-template-rows:auto auto;gap:4px 18px;text-align:left;justify-content:start}.app-choices:has(.matsugram-choice) .choice-symbol{grid-row:1/3;width:54px;height:54px;font-size:31px;border-radius:14px}.app-choices:has(.matsugram-choice) .app-choice strong{font-size:18px;align-self:end;justify-self:start}.app-choices:has(.matsugram-choice) .app-choice>span:last-child{font-size:11px;justify-self:start;align-self:start}.matsugram{padding:0 11px 15px}.mg-shell{height:calc(100svh - 115px);min-height:430px}.mg-header{gap:8px;padding:12px 0}.mg-title{gap:8px}.mg-title h1{font-size:19px;letter-spacing:1px}.mg-mark{width:31px;height:31px;border-radius:9px;font-size:20px}.mg-phase{font-size:9px;padding:4px 7px}.mg-save{font-size:10px}.mg-tabs{margin-bottom:12px;justify-content:space-between}.mg-tabs button{min-width:0;flex:1;padding:10px 12px 13px;font-size:12px}.mg-writing-bar{font-size:10px}.mg-count{font-size:10px}.mg-writing-scroll{padding:9px}.mg-document-scroll{border-radius:8px}.mg-voting-controls{font-size:10px;gap:8px;margin-bottom:9px;min-height:40px}.mg-button{font-size:10px;padding:8px 11px;min-height:37px;gap:6px}.mg-button svg{width:17px}.mg-voting-layout{gap:8px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.mg-voting-document{padding:3px}.mg-voting-document .mg-document{padding:7px}.mg-voting-document .mg-document-profile{min-height:31px;gap:9px;margin-bottom:6px}.mg-voting-document .mg-document-avatar{min-width:25px;border-width:2px}.mg-voting-document .mg-document-profile strong{font-size:12px}.mg-voting-document .mg-document-story{font-size:10px;padding:7px 6px}.mg-voting-document .mg-document-answer{font-size:10px;min-height:55px}.mg-voting-document .mg-document-instruction{font-size:8px}.mg-voting-document .mg-document-ending{padding:3px 5px;min-height:70px}.mg-voting-document .mg-document-logo{width:75%}.mg-voting-document .mg-document-photo{width:83%}.mg-answer-heading{padding:2px 1px 10px;gap:2px}.mg-answer-heading h2{font-size:11px}.mg-vote-count{font-size:10px;padding:4px 7px}.mg-answer-list{padding-left:0;padding-right:0}.mg-answer-strip{min-height:113px;flex-direction:column;align-items:stretch;padding:10px;gap:9px;border-radius:7px;margin-bottom:8px}.mg-strip-body p{font-size:12px;line-height:1.85;margin-top:6px}.mg-anonymous-label{font-size:8px}.mg-like{flex-direction:row;align-self:flex-end;min-height:30px;min-width:58px;font-size:8px;gap:5px;border-radius:7px;padding:4px 7px}.mg-like svg{width:16px;height:16px}.mg-live-votes{right:5px;top:4px;font-size:8px;width:14px;height:14px;min-width:14px;line-height:14px}.mg-live-count{gap:7px}.mg-monitor-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.mg-student-tile{padding:11px;min-height:150px;border-radius:11px}.mg-tile-preview{font-size:11px;padding:8px;min-height:75px}.mg-tile-top strong{font-size:10px}.mg-tile-bottom{font-size:9px}.mg-section-bar{margin-bottom:12px}.mg-section-bar h2,.mg-results-top h2{font-size:14px}.mg-roster-count{font-size:11px}.mg-monitor-view>header{padding:9px 13px;min-height:53px;gap:11px}.mg-monitor-screen{padding:10px}.mg-results-top{margin-bottom:12px}.mg-revealed{font-size:9px}.mg-result-tabs button{font-size:10px;min-height:32px;padding:6px 14px}.mg-result-tabs{margin-bottom:13px}.mg-result-card{padding:15px 12px;gap:11px;min-height:105px;margin-bottom:9px;border-radius:9px}.mg-rank{font-size:23px;min-width:31px}.mg-rank small{font-size:8px}.mg-result-text{font-size:14px;line-height:1.9;margin-top:6px}.mg-result-likes{font-size:16px;gap:5px;margin-left:4px}.mg-result-likes svg{width:17px;height:17px}.mg-ai-launch{padding-top:13px;gap:7px}.mg-ai-button{font-size:15px;min-width:250px;min-height:51px;border-radius:11px;padding:12px 22px}.mg-ai-status{font-size:9px}.mg-ai-heading{margin-bottom:13px}.mg-ai-heading h3{font-size:14px}.mg-ai-reason{font-size:11px;margin-top:12px;padding-top:10px}.mg-feedback-top{margin-top:2px;margin-bottom:16px}.mg-feedback-top h2{font-size:20px}.mg-ai-kicker{font-size:10px}.mg-personal-feedback{padding:21px 19px;border-radius:11px}.mg-personal-feedback blockquote{font-size:15px;padding:13px 15px;margin-bottom:22px}.mg-feedback{font-size:12px}.mg-feedback-summary{font-size:13px}.mg-feedback h3{font-size:12px}.mg-teacher-feedback{padding-left:14px;padding-right:14px}}

/* Compact activity chrome leaves the worksheet and responses the main screen. */
body.matsugram-mode:not(.matsugram-inspecting)>.site-header{height:40px;max-width:none;padding:0 20px;gap:12px;border-bottom:1px solid #e5e9df}
body.matsugram-mode:not(.matsugram-inspecting)>.site-header .brand{gap:0;min-height:32px;flex-shrink:0}
body.matsugram-mode:not(.matsugram-inspecting)>.site-header .brand>span:not(.brand-mark),body.matsugram-mode:not(.matsugram-inspecting)>.site-header .brand-spark{display:none}
body.matsugram-mode:not(.matsugram-inspecting)>.site-header .brand-mark{width:25px;height:25px;border-radius:7px;font-size:17px;box-shadow:none;transform:none}
body.matsugram-mode:not(.matsugram-inspecting)>.site-header .header-tools{gap:8px;flex-wrap:nowrap}
body.matsugram-mode:not(.matsugram-inspecting)>.site-header .icon-button{height:30px;min-width:30px;font-size:17px}
body.matsugram-mode:not(.matsugram-inspecting)>.site-header .text-button{font-size:10px;min-height:30px;padding:5px 9px}
body.matsugram-mode:not(.matsugram-inspecting)>.site-header .identity{font-size:10px;padding:4px 8px;border-radius:6px}
body.matsugram-mode:not(.matsugram-inspecting)>.site-header .connection{font-size:10px}
body.matsugram-mode:not(.matsugram-inspecting) .matsugram:not(.mg-inspecting){max-width:none;margin:0;padding:0 20px 10px}
body.matsugram-mode:not(.matsugram-inspecting) .matsugram:not(.mg-inspecting)>.mg-shell{height:calc(100svh - 50px);min-height:300px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-header{display:grid;grid-template-columns:auto minmax(0,1fr);gap:14px;min-height:48px;padding:2px 0;border-top:0;border-bottom:1px solid var(--mg-line)}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-title{gap:8px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-title h1{font-size:18px;letter-spacing:.6px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-mark{width:26px;height:26px;border-radius:8px;font-size:18px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-phase{font-size:9px;padding:3px 7px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-tabs{justify-self:end;align-self:stretch;align-items:stretch;gap:2px;margin:0;border:0}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-tabs button{min-width:74px;min-height:42px;padding:0 14px;font-size:12px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-tabs button.active:after{bottom:-3px;left:11px;right:11px;height:2px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-save{grid-column:2;justify-self:end;font-size:10px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-demo-bar{min-height:30px;gap:10px;padding:0 8px;margin:0 0 2px;border-width:0 0 1px;border-radius:0;background:#f7f4e9}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-demo-bar>span{gap:9px;flex-direction:row;align-items:center}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-demo-bar strong{font-size:10px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-demo-status{font-size:10px;line-height:1.4}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-demo-bar .mg-button{min-height:28px;padding:3px 9px;font-size:10px;border-radius:6px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-voting-controls{min-height:36px;gap:10px;margin-bottom:4px;font-size:11px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-voting-controls .mg-button{min-height:32px;padding:6px 12px;font-size:11px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-section-bar{min-height:30px;margin:0 0 8px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-section-bar h2{font-size:14px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-writing-bar{margin-top:5px;margin-bottom:5px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-results-top{margin:6px 0 8px}
body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-result-tabs{margin-bottom:9px}

/* Author IDs become prominent only when the existing reveal supplies them. */
.matsugram .mg-result-card .mg-anonymous-label strong,.matsugram .mg-answer-strip .mg-anonymous-label strong{display:inline-flex;align-items:center;margin-left:7px;padding:4px 11px;border-radius:6px;background:#e2efdf;color:#244d32;font:750 22px/1.25 system-ui,sans-serif;vertical-align:middle;letter-spacing:.4px}

@media(max-width:740px){
  body.matsugram-mode:not(.matsugram-inspecting)>.site-header{height:44px;padding:0 10px;gap:8px}
  body.matsugram-mode:not(.matsugram-inspecting)>.site-header .brand{min-width:32px;min-height:44px}
  body.matsugram-mode:not(.matsugram-inspecting)>.site-header .header-tools{gap:4px}
  body.matsugram-mode:not(.matsugram-inspecting)>.site-header .icon-button{height:44px;min-width:44px;border-radius:9px}
  body.matsugram-mode:not(.matsugram-inspecting)>.site-header .text-button{min-height:44px;padding:5px 7px}
  body.matsugram-mode:not(.matsugram-inspecting)>.site-header .connection{font-size:0;gap:0}
  body.matsugram-mode:not(.matsugram-inspecting) .matsugram:not(.mg-inspecting){padding:0 10px 8px}
  body.matsugram-mode:not(.matsugram-inspecting) .matsugram:not(.mg-inspecting)>.mg-shell{height:calc(100svh - 52px);min-height:300px}
  body.matsugram-mode .matsugram:not(.mg-inspecting).mg-teacher .mg-header{grid-template-columns:auto minmax(0,1fr);gap:0 8px;min-height:44px;padding:0}
  body.matsugram-mode .matsugram:not(.mg-inspecting).mg-teacher .mg-title{grid-column:1;grid-row:1;min-height:44px;gap:7px}
  body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-title h1{font-size:17px}
  body.matsugram-mode .matsugram:not(.mg-inspecting).mg-teacher .mg-tabs{grid-column:2;grid-row:1;justify-self:stretch;justify-content:stretch;min-height:44px}
  body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-tabs button{min-width:0;min-height:44px;flex:1;padding:0 8px;font-size:11px}
  body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-tabs button.active:after{bottom:-1px}
  body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-demo-bar{min-height:44px;padding:0 4px;margin-bottom:2px}
  body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-demo-bar strong{display:none}
  body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-demo-bar .mg-button{min-height:44px;padding:5px 8px;font-size:10px}
  body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-voting-controls{min-height:44px;gap:8px;margin-bottom:4px;font-size:10px}
  body.matsugram-mode .matsugram:not(.mg-inspecting) .mg-voting-controls .mg-button{min-height:44px;padding:6px 9px;font-size:10px}
  .matsugram .mg-result-card .mg-anonymous-label strong,.matsugram .mg-answer-strip .mg-anonymous-label strong{font-size:18px;padding:4px 8px;margin-left:5px}
}
@media(max-width:420px){body.matsugram-mode .matsugram:not(.mg-inspecting).mg-teacher .mg-phase{display:none}}
