/* NaRa Academy v0.25.7.4 — Calculation + lesson responsive polish */

/* ---------- shared calculator editor ---------- */
.calc-add-help{
  margin:-4px 0 12px;padding:11px 13px;border:1px solid #eadfce;border-radius:13px;
  background:#fffaf1;color:#806f61;font-size:12px;line-height:1.5
}
.calc-editor{
  margin-top:14px;padding:18px;border:1px solid #e4d6c7;border-radius:20px;
  background:linear-gradient(180deg,#fffdf9 0%,#fffaf3 100%);min-width:0
}
.calc-editor *{box-sizing:border-box}
.calc-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}
.calc-editor-head b{font-size:18px;color:#3d3027}
.calc-editor-head .help{margin-top:4px;line-height:1.45}
.calc-table-head,.calc-row{
  display:grid;grid-template-columns:1.1fr minmax(150px,1.55fr) minmax(150px,1.2fr) minmax(120px,.9fr) minmax(120px,.9fr) minmax(130px,1fr) 40px;
  gap:8px;align-items:end;min-width:0
}
.calc-table-head{padding:0 3px 8px;color:#8c7f74;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.03em}
.calc-row{padding:11px 0;border-top:1px solid #eee4d8}
.calc-row:first-child{border-top:0}
.calc-cell{display:grid;gap:5px;min-width:0;margin:0}
.calc-mobile-label{display:none;color:#8d8075;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.04em}
.calc-row input,.calc-row select{
  width:100%;min-width:0;height:44px;border:1px solid #ddd1c3;border-radius:10px;padding:0 10px;
  background:#fff;font:inherit;color:#493b31
}
.calc-row input:focus,.calc-row select:focus{outline:2px solid rgba(203,151,39,.22);border-color:#c7952d}
.calc-row output{font-weight:900;color:#47372c;white-space:nowrap;text-align:right;align-self:center}
.calc-qty-unit{display:grid;grid-template-columns:minmax(0,1fr) 68px;gap:6px;min-width:0}
.calc-remove{width:38px;height:38px;border-radius:10px;border:1px solid #e4cfc9;background:#fff7f5;color:#a14439;font-size:22px;line-height:1;cursor:pointer;align-self:center}
.calc-remove:hover{background:#fff0ed}
.calc-production-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:18px;padding-top:17px;border-top:1px dashed #dfd2c4
}
.calc-production-grid .field{margin:0;min-width:0}
.calc-live-summary{display:grid;grid-template-columns:1fr 1fr 1.35fr;gap:10px;margin-top:14px}
.calc-live-summary>div{padding:14px 15px;border:1px solid #e7dacb;border-radius:15px;background:#fff;display:grid;gap:4px;min-width:0}
.calc-live-summary small{color:#8d8075;font-size:11px;font-weight:800;line-height:1.35}
.calc-live-summary strong{font-size:20px;color:#392c24;overflow-wrap:anywhere}
.calc-live-summary .recommended{background:#3a2b22;border-color:#3a2b22}
.calc-live-summary .recommended small{color:#d9c9bb}.calc-live-summary .recommended strong{color:#e1b65a}
.calc-language-note{margin-top:11px;color:#8f8175;font-size:11px;line-height:1.5}

/* ---------- rendered calculation ---------- */
.ac257-calc{
  padding:0!important;overflow:hidden!important;border:1px solid #e3d6c7!important;background:#fff!important;
  box-shadow:0 16px 42px rgba(58,40,27,.065);max-width:100%;min-width:0
}
.ac257-calc *{box-sizing:border-box}
.ac257-calc-head{
  display:flex;justify-content:space-between;gap:22px;align-items:flex-start;padding:26px 26px 20px;
  background:linear-gradient(135deg,#fffaf0 0%,#fffdf9 55%,#fff 100%)
}
.ac257-title-copy{min-width:0;max-width:700px}
.ac257-kicker{font-size:11px;font-weight:900;letter-spacing:.14em;text-transform:uppercase;color:#b4872f;margin-bottom:7px}
.ac257-calc-head h2{margin:0!important;font-family:Georgia,serif;font-size:clamp(28px,3vw,38px)!important;line-height:1.08!important;color:#3d2e25;overflow-wrap:anywhere}
.ac257-formula{margin:10px 0 0;color:#88796d;font-size:12px;line-height:1.5;max-width:620px}
.ac257-batch-pill{
  min-width:220px;padding:14px 16px;border-radius:16px;background:#38291f;color:#fff;display:grid;gap:3px;text-align:right;flex:0 0 auto
}
.ac257-batch-pill small{font-size:10px;color:#d6c6b8;font-weight:800}.ac257-batch-pill strong{font-size:23px;color:#e6bb5b;line-height:1.1}
.ac257-batch-pill span{font-size:10px;color:#bfae9f;margin-top:2px}
.ac257-table-wrap{padding:0 26px;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.ac257-table{width:100%;border-collapse:collapse;table-layout:auto}
.ac257-table th{padding:11px 10px;border-bottom:1px solid #dccfc1;color:#887b70;font-size:10px;line-height:1.25;letter-spacing:.04em;text-transform:uppercase;text-align:left;vertical-align:bottom}
.ac257-table td{padding:13px 10px;border-bottom:1px solid #eee5db;color:#574940;font-size:13px;line-height:1.4;vertical-align:middle}
.ac257-table th:first-child,.ac257-table td:first-child{padding-left:0}.ac257-table th:last-child,.ac257-table td:last-child{padding-right:0}
.ac257-table .ac257-item-name{min-width:170px;max-width:290px;overflow-wrap:anywhere}.ac257-table .ac257-cost-cell{text-align:right;white-space:nowrap;color:#372a22}
.ac257-category-chip{display:inline-flex;align-items:center;max-width:100%;padding:6px 9px;border-radius:999px;background:#faf4e8;border:1px solid #eadfc9;color:#876a31;font-size:10px;font-weight:900;line-height:1.15;white-space:normal;text-align:center}
.ac257-mobile-list{display:none}
.ac257-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:20px 26px 18px}
.ac257-summary>div{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 13px;border-radius:13px;background:#faf6f0;color:#76685d;font-size:12px;min-width:0}
.ac257-summary span{overflow-wrap:anywhere}.ac257-summary b{color:#493a31;white-space:nowrap}
.ac257-result-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:0 26px 26px}
.ac257-result-card{padding:16px;border:1px solid #e8ddcf;border-radius:16px;background:#fff;display:grid;gap:5px;min-width:0}
.ac257-result-card small{font-size:10px;line-height:1.35;color:#8e8176;font-weight:800}.ac257-result-card strong{font-size:21px;line-height:1.15;color:#3c2f27;overflow-wrap:anywhere}
.ac257-profit{background:#fffaf1}
.ac257-recommended{grid-column:span 2;background:#3b2c22!important;border-color:#3b2c22!important;position:relative;padding-right:72px}
.ac257-recommended small{color:#d8c8bb!important}.ac257-recommended strong{font-size:28px!important;color:#e5bb5d!important}
.ac257-recommended>span{position:absolute;right:16px;bottom:17px;color:#d8c8bb;font-size:12px;font-weight:800}
.ac257-empty{padding:0 26px 26px;color:#897b70}

/* ---------- generic lesson safety ---------- */
.student-grid,.student-lesson-main,.student-lesson-main>*{min-width:0}
.student-lesson-main .nara-block{max-width:100%;overflow:hidden}
.student-lesson-main .nara-heading h2,.student-title,.lesson-nav-list b{overflow-wrap:anywhere;word-break:normal}
.student-lesson-main img,.student-lesson-main video,.student-lesson-main iframe{max-width:100%}
.student-lesson-main .nara-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.student-lesson-main .nara-content-table{min-width:560px}
.course-aside{min-width:0}
.lesson-nav-list a{min-width:0}.nav-lesson-copy{min-width:0}

/* ---------- tablet ---------- */
@media(max-width:1100px){
  .calc-table-head{display:none}
  .calc-row{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;padding:14px;border:1px solid #e9ddd0;border-radius:15px;background:#fff;margin-bottom:10px}
  .calc-row>*{min-width:0}.calc-mobile-label{display:block}.calc-row output{text-align:left}
  .calc-remove{justify-self:end;align-self:end}
  .calc-production-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .calc-live-summary{grid-template-columns:1fr 1fr}.calc-live-summary .recommended{grid-column:1/-1}
  .ac257-result-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ac257-recommended{grid-column:1/-1}
}

/* ---------- mobile: calculator becomes cards, never horizontal-scrolls ---------- */
@media(max-width:760px){
  .calc-editor{padding:13px;border-radius:17px}
  .calc-editor-head{display:grid;gap:10px}.calc-editor-head .btn{width:100%}
  .calc-row{grid-template-columns:1fr;padding:13px;gap:10px;margin-bottom:12px}
  .calc-cell{gap:6px}.calc-mobile-label{display:block}
  .calc-qty-unit{grid-template-columns:minmax(0,1fr) 82px}
  .calc-row input,.calc-row select{height:48px;font-size:16px}
  .calc-row output{font-size:19px;background:#fffaf1;border:1px solid #eadfcf;border-radius:11px;padding:11px 12px;width:100%}
  .calc-remove{justify-self:stretch;width:100%;height:42px}
  .calc-production-grid,.calc-live-summary{grid-template-columns:1fr}
  .calc-live-summary .recommended{grid-column:auto}

  .ac257-calc-head{display:grid;padding:21px 18px 16px;gap:15px}
  .ac257-calc-head h2{font-size:clamp(27px,8vw,36px)!important}
  .ac257-formula{font-size:11px}
  .ac257-batch-pill{min-width:0;width:100%;text-align:left;padding:14px 15px}
  .ac257-batch-pill strong{font-size:25px}
  .ac257-table-desktop{display:none}
  .ac257-mobile-list{display:grid;gap:11px;padding:2px 18px 18px}
  .ac257-mobile-item{border:1px solid #e7dccf;border-radius:16px;background:#fff;padding:14px;box-shadow:0 7px 20px rgba(58,40,27,.035);min-width:0}
  .ac257-mobile-item-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding-bottom:11px;border-bottom:1px solid #eee5dc}
  .ac257-mobile-item-head>div{display:flex;align-items:flex-start;gap:9px;min-width:0}.ac257-mobile-item-head b{font-size:16px;line-height:1.28;color:#4d4037;overflow-wrap:anywhere}
  .ac257-row-number{display:grid;place-items:center;flex:0 0 25px;width:25px;height:25px;border-radius:50%;background:#f4ead5;color:#a57a27;font-size:11px;font-weight:900}
  .ac257-mobile-item dl{display:grid;grid-template-columns:1fr 1fr;gap:0;margin:8px 0 0}
  .ac257-mobile-item dl>div{padding:9px 8px 8px 0;min-width:0}.ac257-mobile-item dl>div:nth-child(even){padding-left:8px;padding-right:0;border-left:1px solid #f0e7dd}
  .ac257-mobile-item dt{font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.03em;color:#998c81;margin-bottom:4px;line-height:1.25}
  .ac257-mobile-item dd{margin:0;font-size:14px;font-weight:800;color:#4a3b32;overflow-wrap:anywhere}
  .ac257-mobile-item .ac257-mobile-cost{grid-column:1/-1;border-top:1px solid #f0e7dd;border-left:0!important;padding:11px 0 0!important;display:flex;align-items:end;justify-content:space-between;gap:12px}
  .ac257-mobile-item .ac257-mobile-cost dt{margin:0}.ac257-mobile-item .ac257-mobile-cost dd{font-size:18px;color:#a57621;white-space:nowrap}
  .ac257-category-chip{font-size:9px;flex:0 0 auto;max-width:120px}
  .ac257-summary{grid-template-columns:1fr;padding:0 18px 17px;gap:8px}
  .ac257-summary>div{font-size:13px;padding:12px 13px}
  .ac257-result-grid{grid-template-columns:1fr;padding:0 18px 20px;gap:9px}
  .ac257-result-card{padding:15px 16px}.ac257-result-card strong{font-size:23px}
  .ac257-recommended{grid-column:auto;padding-right:16px}.ac257-recommended strong{font-size:27px!important}.ac257-recommended>span{position:static;margin-top:1px}

  .student-shell{max-width:100%;padding-left:12px!important;padding-right:12px!important}
  .student-grid{display:block!important;max-width:100%}
  .student-lesson-main .nara-block{border-radius:20px!important;margin:14px 0!important}
  .student-lesson-main .nara-heading{padding-left:2px!important;padding-right:2px!important}
  .student-lesson-main .nara-heading h2{font-size:clamp(27px,8vw,36px)!important;line-height:1.12!important}
  .student-lesson-main .nara-player{border-radius:16px!important}
  .student-lesson-main .nara-content-table{min-width:620px}
  .lesson-completion-card{max-width:100%;overflow:hidden}
  .lesson-completion-card form,.lesson-complete-form{width:100%}
  .lesson-completion-card .student-btn,.lesson-complete-form .student-btn{max-width:100%;white-space:normal;text-align:center}
  .lesson-footer{gap:8px;grid-template-columns:1fr!important}.lesson-footer>div{min-width:0}.lesson-footer .student-btn{width:100%;text-align:center;white-space:normal}
  .course-aside{position:static!important;margin-top:18px;max-width:100%}
}

@media(max-width:430px){
  .ac257-calc-head{padding-left:15px;padding-right:15px}
  .ac257-mobile-list,.ac257-summary,.ac257-result-grid{padding-left:15px;padding-right:15px}
  .ac257-mobile-item{padding:13px}
  .ac257-mobile-item dl{grid-template-columns:1fr}.ac257-mobile-item dl>div:nth-child(even){padding-left:0;border-left:0}.ac257-mobile-item dl>div{padding:8px 0;border-top:1px solid #f3ebe3}.ac257-mobile-item dl>div:first-child{border-top:0}
  .ac257-category-chip{max-width:105px}
  .calc-qty-unit{grid-template-columns:minmax(0,1fr) 72px}
}
