:root{--navy:#333399;--red:#e33b36;--ink:#171717;--line:#d8d8df;--muted:#62626b}
*{box-sizing:border-box}html{background:#fff;scroll-behavior:smooth}body{margin:0;background:#fff;color:var(--ink);font:15px/1.6 Arial,Helvetica,sans-serif}a{color:var(--navy);text-decoration:none}a:hover{text-decoration:underline}button,summary{font:inherit}button,a,summary{-webkit-tap-highlight-color:transparent}:focus-visible{outline:2px solid var(--navy);outline-offset:4px}button{cursor:pointer;background:#fff;border:1px solid var(--line);border-radius:3px;color:var(--ink);min-height:38px;padding:5px 12px}button:hover:not(:disabled){background:#f5f5fa}button:disabled{opacity:.28;cursor:default}
.toolbar{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:14px;min-height:76px;padding:16px 28px;background:rgba(255,255,255,.97);border-bottom:1px solid #f2f2f5}.back{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--line);border-radius:3px;font-size:22px;color:#555}.topic-name{font-size:12px;color:var(--muted);margin-right:auto}.pager{display:flex;align-items:center;gap:10px;white-space:nowrap}.count{font-size:13px;min-width:46px;text-align:center;font-variant-numeric:tabular-nums}.contents{position:relative}.contents summary{list-style:none;cursor:pointer;font-size:12px;padding:7px 10px;border:1px solid var(--line);border-radius:3px}.contents summary::-webkit-details-marker{display:none}.contents ol{position:absolute;right:0;top:35px;min-width:290px;max-width:calc(100vw - 28px);max-height:65vh;overflow:auto;background:white;border:1px solid var(--line);box-shadow:0 8px 32px #0000000d;padding:18px 22px 18px 42px;line-height:1.45}.contents li{padding:7px 0;font-size:13px}.contents a[aria-current=page]{font-weight:bold}
main{max-width:1216px;margin:auto;padding:42px 34px 70px}.sheet[hidden]{display:none!important}.sheet-layout{display:block;max-width:790px;margin:0 auto}.paper{background:white;box-shadow:0 2px 18px #15152d0b;border:1px solid #f0f0f3;padding:32px 34px;min-width:0}.paper h1,.paper .case-title{font-size:18px;line-height:1.35;margin:0 0 22px;color:var(--ink);font-weight:bold;letter-spacing:0}.paper p{margin:0 0 16px}.paper .case-number{display:block;font-size:11px;color:var(--navy);margin-bottom:7px}.questions{list-style:none;padding:0;margin:24px 0 0}.questions li{display:grid;grid-template-columns:22px 1fr;gap:8px;margin:0 0 17px}.question-letter{font-weight:bold;color:var(--navy)}.answers{min-width:0;padding:36px 0 0}.answer{position:relative;margin:0 0 32px}.answer h3{font-size:13px;line-height:1.5;color:var(--navy);font-weight:bold;margin:0 0 14px}.answer h3 span{margin-right:8px}.answer p{margin:12px 0}.answer .result{color:var(--red);font-size:16px;font-weight:bold}.equation{overflow-x:auto;overflow-y:hidden;max-width:100%;padding:5px 0;color:var(--navy);margin:13px 0}.equation .katex-display{margin:0}.equation .katex-display>.katex{text-align:left;font-size:1.12em}.equation .katex-display>.katex>.katex-html{padding:2px 0}.paper .equation{font-size:.94em}.table-scroll{max-width:100%;overflow:auto;margin:20px 0;scrollbar-width:thin}table{width:100%;border-collapse:collapse;font-size:12.5px;line-height:1.5;font-variant-numeric:tabular-nums lining-nums}caption{text-align:left;font-weight:bold;color:var(--navy);padding:0 0 10px}th,td{padding:9px 10px;border-bottom:1px solid #e5e5eb;vertical-align:middle}thead th{border-top:1px solid #a7a7ba;border-bottom:1px solid #a7a7ba;color:var(--navy);font-weight:bold;text-align:right}thead th:first-child{text-align:left}tbody th{text-align:left;font-weight:normal}td{text-align:right;white-space:nowrap}tbody tr.total{border-top:1px solid #88889b;color:var(--red);font-weight:bold}.paper td{color:var(--navy)}.table-scroll table th:first-child{min-width:115px}.answer .total th{font-weight:bold}.links{position:absolute;inset:0;pointer-events:none;overflow:visible;width:100%;height:100%;z-index:1}.links path{fill:none;stroke:#8f8fc0;stroke-width:1}.source{font-size:11px;line-height:1.6;color:var(--muted);border-top:1px solid #ededf2;margin-top:36px;padding-top:13px}.source summary{cursor:pointer;width:fit-content}.source p{max-width:90ch}.diagram{margin:25px 0}.diagram img{width:100%;height:auto;display:block}.timeline{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;font-size:11px;text-align:center;margin:26px 0 12px;padding-top:12px;border-top:1px solid var(--navy);color:var(--navy)}.timeline span{position:relative}.timeline span:before{content:'';width:5px;height:5px;background:var(--navy);position:absolute;left:50%;top:-15px;border-radius:50%}.wide .sheet-layout{display:block}.wide .paper{max-width:790px;margin:0 auto 40px}.wide .answers{max-width:1080px;margin:auto}.wide .answer{margin-bottom:32px}.wide table{font-size:13px}.wide .answer h3{font-size:14px}.wide .links{display:none}.theory-paper{max-width:790px;margin:auto;padding:38px 45px}.theory-paper h2{font-size:16px;color:var(--navy);margin:28px 0 12px}.theory-paper p{margin:12px 0}.endnav{display:flex;justify-content:space-between;gap:20px;margin:45px 0 0;padding:20px 0;border-top:1px solid #ededf2;font-size:12px}.endnav a:last-child{margin-left:auto;text-align:right}.sheet h1[tabindex]:focus{outline:none}
@media(max-width:980px){main{max-width:820px;padding:32px 25px 55px}.sheet-layout{display:block}.paper{margin-bottom:32px}.links{display:none}.answers{padding:0 12px}.toolbar{gap:10px;padding:14px 20px}.answer h3{font-size:14px}.answer .diagram{max-width:520px}}
@media(max-width:600px){body{font-size:15px}.toolbar{padding:10px 14px;flex-wrap:wrap;gap:9px;min-height:65px}.topic-name{font-size:11px;max-width:135px;line-height:1.35}.pager{gap:5px}.pager button{padding:5px 9px;min-width:38px}.contents summary{font-size:11px}.count{min-width:36px;font-size:12px}main{padding:22px 15px 40px}.paper,.theory-paper{padding:24px 20px}.paper h1,.paper .case-title{font-size:18px}.answers{padding:0 5px}table{font-size:12px}th,td{padding:8px}.wide table{font-size:12px}.wide .paper{margin-bottom:28px}.equation .katex-display>.katex{font-size:1.03em}.endnav{font-size:11px}.topic-name{order:0}.contents{margin-left:auto}.pager{margin-left:auto}}
@media print{body{font-size:10pt}.toolbar,.contents,.links,.source,.endnav{display:none!important}main{max-width:none;padding:0}.sheet-layout{display:block}.paper,.theory-paper{box-shadow:none;border:0;padding:0;margin:0 0 24px}.answers{padding:0}.answer{break-inside:avoid}.table-scroll,.equation{overflow:visible}table{font-size:9pt}.diagram{max-width:120mm}a{color:inherit}.sheet[hidden]{display:none!important}@page{size:A4;margin:18mm}}

.pager{gap:4px;flex-wrap:wrap}.pager a{display:grid;place-items:center;min-width:30px;min-height:32px;padding:2px 7px;font-size:12px;color:var(--muted);border-bottom:1px solid transparent}.pager a[aria-current="page"]{color:var(--navy);border-bottom-color:var(--navy);font-weight:bold}.wide .sheet-layout{max-width:1080px}.wide .answers{padding-top:0}@media(max-width:980px){.answers{padding:32px 12px 0}}@media(max-width:600px){.topic-name{max-width:none}.pager{margin-left:0}.answers{padding:28px 5px 0}}

.task-title{font-size:20px;line-height:1.4;font-weight:normal;color:var(--navy);max-width:790px;margin:0 auto 28px}.exercise-case{margin-bottom:64px}.exercise-case:last-child{margin-bottom:0}.exercise-case+.exercise-case{padding-top:12px}.paper .case-title{font-weight:bold}.sheet .task-title:focus{outline:none}@media(max-width:600px){.task-title{font-size:18px}.exercise-case{margin-bottom:46px}}

.toolbar>.pager{margin-left:auto}.toolbar>.back{flex-shrink:0}

/* Keep solution labels on the same column as the corresponding question labels. */
body{font-size:13px;line-height:1.6}
.task-title{font-size:17px}
.paper,.wide .paper{margin-bottom:0}
.answers,.wide .answers{max-width:790px;margin:0 auto;padding:30px 35px 0}
.answer{display:grid;grid-template-columns:22px minmax(0,1fr);gap:8px;align-items:start;margin-bottom:26px}
.answer h3,.wide .answer h3{font-size:13px;line-height:1.6;margin:0}
.answer-content{min-width:0}
.answer-content>:first-child{margin-top:0}
.answer .result{font-size:14px}
.equation .katex-display>.katex{font-size:1.08em}
table,.wide table{font-size:11.5px}
@media(max-width:600px){body{font-size:13px}.task-title{font-size:16px}.answers,.wide .answers{padding:24px 21px 0}.paper,.wide .paper{margin-bottom:0}.answer h3,.wide .answer h3{font-size:13px}}

/* Compact letter width for the smaller exercise text. */
.sheet-layout,.wide .sheet-layout,.wide .paper,.answers,.wide .answers,.task-title{max-width:620px}

/* Spreadsheet grid, using the MIT worksheet palette. */
.table-scroll table{border:1px solid #b8b8cf;background:#fff;line-height:1.4}
.table-scroll th,.table-scroll td{border:1px solid #d4d4e1;padding:7px 9px}
.table-scroll thead th{background:#e9e9f5;color:var(--navy);border-color:#b8b8cf;font-weight:bold;white-space:nowrap}
.table-scroll tbody th{background:#f4f4fa;color:var(--navy);font-weight:normal;min-width:130px}
.table-scroll td,.paper .table-scroll td{color:var(--ink);font-variant-numeric:tabular-nums lining-nums}
.table-scroll tbody tr.total th,.table-scroll tbody tr.total td{background:#fceeed;color:var(--red);font-weight:bold;border-top:2px solid var(--red)}
.table-scroll tbody tr:hover td{background:#f4f4fa}
.table-scroll tbody tr.total:hover td{background:#fceeed}

/* Align tables with the surrounding text. Keep content-sized columns;
   wider schedules continue vertically with repeated row labels. */
.table-scroll{position:relative;overflow:visible}
.table-scroll table{width:auto;max-width:100%;table-layout:auto;margin-left:0;margin-right:0}
.table-scroll th,.table-scroll td{padding:7px 5px}
.table-scroll table th:first-child{min-width:0}
.table-scroll table+table{margin-top:20px}
.table-scroll .table-measure{width:auto;max-width:100%;position:absolute;left:0;visibility:hidden;pointer-events:none}

.answers .table-scroll{max-width:1100px}

/* Calculation-to-result flow: inline when legible, stacked on narrow screens. */
.result-flow{position:relative;display:grid;grid-template-columns:minmax(0,1fr);row-gap:28px;margin:13px 0 18px;align-items:center}
.flow-calculations{min-width:0}
.flow-calculations>.equation:first-child,.flow-calculations>.table-scroll:first-child{margin-top:0}
.flow-calculations>.equation:last-child,.flow-calculations>.table-scroll:last-child{margin-bottom:0}
.result-flow>.result{width:max-content;max-width:100%;margin:0}
.result-flow.is-inline{grid-template-columns:var(--calculation-width) minmax(0,1fr);column-gap:40px;row-gap:0;align-items:start}
.result-flow.is-inline>.result{width:max-content;max-width:none}
.result-flow.single-line-result>.result{max-width:none;white-space:nowrap}
.result-connectors{position:absolute;left:0;top:0;overflow:visible;pointer-events:none}

/* Only explicitly marked general formulas receive a frame; numerical steps stay open. */
.equation.formula-reference{width:fit-content;max-width:100%;border:1px dashed var(--red);border-radius:0;background:#fff;padding:9px 10px;box-sizing:border-box}
/* The answer label remains aligned with the question; the comparison uses the
   available space to its right. Corresponding calculation rows stay level. */
.eac-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));gap:28px;width:max-content;max-width:min(760px,calc(50vw + 220px));margin:0 0 24px;align-items:start}
.eac-option{min-width:0}
.eac-option h4{color:var(--navy);font-size:13px;line-height:1.6;font-weight:bold;margin:0 0 14px}
.eac-option>.equation{margin:13px 0}
.eac-option>.equation:last-child{margin-bottom:0}
@media(max-width:640px){.eac-comparison{width:100%;max-width:100%;grid-template-columns:minmax(0,1fr);gap:24px}}
@media print{.eac-comparison{width:100%}.equation{break-inside:avoid}}

/* Keep solutions inside their text column, including legacy worksheet pages. */
.result-flow{max-width:100%}
.result-flow>.result{overflow-wrap:anywhere}
.eac-comparison{width:100%;max-width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}
.eac-comparison.is-stacked{grid-template-columns:minmax(0,1fr)}
.table-scroll table{margin-left:auto;margin-right:auto}
.table-scroll{max-width:100%;overflow-x:auto}

/* Comfortable default reading size across Corporate Finance exercises. */
@media screen {
  body{font-size:16px}
  .sheet-layout,.wide .sheet-layout,.wide .paper,.answers,.wide .answers,.task-title{max-width:760px}
  .task-title{font-size:21px}
  .paper .case-number{font-size:13px}
  .answer{grid-template-columns:26px minmax(0,1fr)}
  .questions li{grid-template-columns:26px minmax(0,1fr)}
  .answer h3,.wide .answer h3,.eac-option h4{font-size:16px}
  .answer .result{font-size:17px}
  table,.wide table{font-size:14px}
  .timeline{font-size:13px}
}
@media screen and (max-width:600px) {
  .task-title{font-size:20px}
  table,.wide table{font-size:13px}
}

/* Successive balances read in chronological order, with each result beside its calculation. */
#metodi-11 .solution-step{margin-top:24px}
#metodi-11 .solution-step h4{margin:0 0 10px;color:var(--navy);font-size:1em;line-height:1.5;font-weight:normal}
#metodi-11 .solution-step>.result-flow{margin:0}
