
:root{
      --bg:#f5f8fa; --surface:#fff; --card:#fff; --border:#e5e7eb; --shadow:0 10px 30px rgba(17,24,39,.08);
      --text:#111827; --muted:#6b7280; --brand:#4f7cff; --brand-soft-1:#6f8dff; --brand-soft-2:#5e7eff;
      --ring:rgba(79,124,255,.22); --accent-1:#6ec1f5; --accent-2:#2b88d8; --accent-border:#cfeaff; --btn-text:#fff;
      --input-bg:#fff; --input-border:#d1d5db; --pill-bg:#f1f5ff; --pill-border:#dbe4ff; --pill-dot:#6585ff; --pill-text:#253bff;
      --bar-bg:#eef2ff; --bar-mat:#5b86ff; --bar-waste:#8a6cff; --details-bg:#fff; --details-border:#e5e7eb;
      --pill-h:28px; --pill-px:10px; --pill-fs:.90rem; --desk-w:1280px; --desk-h:1024px;

      --hero-bg:
        radial-gradient(1200px 400px at 0% 0%, color-mix(in oklab, var(--brand), white 88%) 0%, transparent 60%),
        linear-gradient(180deg, color-mix(in oklab, var(--surface), white 6%), var(--card));
      --nav-link:#374151;

      --hero-gap:0px;
      --title-lift:30px;

      --hero-img:url('/resources/pic/header_image_v1.001.svg');
      --hero-img-size:cover;
      --hero-img-pos:center right;
      --hero-img-opacity:.8;
      --hero-img-blur:0px;
    }
    [data-theme="dark"]{
      --bg:#0f172a; --surface:#0b1022; --card:#0b1226cc; --border:#1e293b; --shadow:0 10px 30px rgba(0,0,0,.35);
      --text:#e2e8f0; --muted:#94a3b8; --brand:#6aa4ff; --brand-soft-1:#7fb1ff; --brand-soft-2:#679cff; --ring:rgba(106,164,255,.25);
      --input-bg:#0b1326; --input-border:#1b2440; --pill-bg:#0d1733; --pill-border:#1b2440; --pill-dot:#89a8ff; --pill-text:#d7e3ff;
      --bar-bg:#0d1733; --bar-mat:#4d79ff; --bar-waste:#7d61ff; --details-bg:#0c142a; --details-border:#1b2440;
      --accent-1:#3a96e6; --accent-2:#1679c1; --accent-border:#145f98; --btn-text:#fff;
      --nav-link:#cbd5e1;
    }

    html,body{height:100%}
    body{
      margin:0;
      background:
        radial-gradient(900px 480px at -10% -10%, rgba(142,197,252,.20), transparent 60%),
        radial-gradient(900px 480px at 110% -10%, rgba(196,181,253,.18), transparent 60%),
        var(--bg);
      color:var(--text);
      font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,Apple SD Gothic Neo,Noto Sans,sans-serif;
      line-height:1.6;
    }
    a{color:#365cfb;text-decoration:none}
    a:hover{text-decoration:underline}

    .post-language-link {
      margin-top: 2rem;
      padding-top: 1rem;
      border-top: 1px solid rgba(148, 163, 184, 0.24);
      font-size: 0.95rem;
      color: var(--muted-text, var(--muted));
    }

    .post-neighbor-nav {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.75rem;
      margin-top: 1rem;
    }

    .post-neighbor-link {
      min-width: 0;
      padding-top: 0.75rem;
      border-top: 1px solid rgba(148, 163, 184, 0.18);
      color: var(--text);
    }

    .post-neighbor-link span {
      display: block;
      margin-bottom: 0.2rem;
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0;
      color: var(--muted-text, var(--muted));
      text-transform: uppercase;
    }

    .post-neighbor-link strong {
      display: block;
      font-size: 0.95rem;
      line-height: 1.45;
    }

    @media (max-width: 640px) {
      .post-neighbor-nav {
        grid-template-columns: 1fr;
      }
    }

    .wrap{max-width:1280px;margin:0 auto;padding:24px}
    .card{background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow)}
    .padded{padding:18px}

    .breadcrumb{
      display:flex; align-items:center; justify-content:space-between;
      gap:8px; color:var(--muted); font-size:.92rem; line-height:1.2; margin-bottom:10px; flex-wrap:nowrap;
      padding:12px 14px;
    }
    .breadcrumb a{color:var(--muted)}
    .brandbar{display:flex; align-items:center; gap:8px; flex:1 1 auto; min-width:0}
    .brandbar img{height:65px; width:auto; display:block; transform:translateY(-4px)}

    .top-actions.t-inline{
      display:flex; align-items:center; gap:10px;
      white-space:nowrap; margin-left:auto; position:static; font-size:.8rem;
    }
    .top-actions .t-link,
    .top-actions .lang-toggle,
    .top-actions .theme-toggle{
      background:none; border:0; box-shadow:none; padding:0; margin:0; transform: translateY(-1.5rem);
      color:var(--nav-link); text-decoration:none;
      font:inherit; line-height:1; cursor:pointer; display:inline-flex; align-items:center; gap:6px;
    }
    .top-actions [data-theme-toggle] .txt{display:inline; visibility:visible}

    .hero-combo{
      background:var(--hero-bg);
      border:1px solid var(--border);
      border-radius:16px;
      box-shadow:var(--shadow);
      overflow:hidden;
      margin-bottom:14px;
      position:relative;
    }
    .hero-combo .breadcrumb,
    .hero-combo .title-card{
      background:transparent; border:0; box-shadow:none; margin:0;
    }
    .hero-combo > .breadcrumb{ margin-bottom:var(--hero-gap); }
    .hero-combo > .title-card{ margin-top:calc(-1 * var(--title-lift)); position:relative; z-index:1; }
    .hero-combo::before{
      content:""; position:absolute; inset:0; z-index:0;
      background-image:var(--hero-img);
      background-size:var(--hero-img-size);
      background-position:var(--hero-img-pos);
      background-repeat:no-repeat;
      opacity:var(--hero-img-opacity);
      filter:blur(var(--hero-img-blur));
    }
    .hero-combo > *{ position:relative; z-index:1; }
    [data-theme="dark"] .hero-combo::after{
      content:""; position:absolute; inset:0; z-index:0; pointer-events:none;
      background:linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.10));
    }

    .title-card{
      position:relative;
      border:1px solid var(--border);
      border-radius:16px;
      background:var(--hero-bg);
      box-shadow:var(--shadow);
      overflow:hidden;
      margin:8px 0 14px;
    }
    .tc-row{display:grid; grid-template-columns:1.3fr 0.7fr; align-items:center; gap:20px}
    .tc-left{min-width:0}
    .tc-right{display:flex; justify-content:center; align-items:center; color:var(--brand)}
    .tc-blob{width:100%; height:auto; max-width:220px}
    .title-card h1{margin:6px 0 6px; line-height:1.15;}
    .tc-sub{color:var(--muted); margin:0 0 10px}
    .hero-combo .title-card .tc-left a{color:var(--nav-link); text-decoration:none}
    .hero-combo .title-card .tc-left a:hover{color:var(--nav-link); text-decoration:none}

    .grid{display:grid;grid-template-columns:1.65fr 1fr;gap:18px}
    .grid > * { min-width: 0; }
    .main-col{order:1}
    .calc-col{order:2}

    .hero{
      position:relative;padding:18px;border-radius:14px;border:1px solid var(--border);
      background:
        radial-gradient(600px 240px at 0% -10%, rgba(79,124,255,.12), transparent 60%),
        radial-gradient(600px 240px at 100% 0%, rgba(138,108,255,.12), transparent 60%),
        var(--surface);
    }
    .hero h2{margin:0 0 6px 0;font-size:1.2rem}
    .hero p{margin:0;color:var(--muted)}

    .pill-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
    .pill{
      display:inline-flex;gap:8px;align-items:center;padding:0 var(--pill-px);border-radius:999px;font-size:var(--pill-fs);
      background:var(--pill-bg);border:1px solid var(--pill-border);color:var(--pill-text);height:var(--pill-h);
      font-weight:600;line-height:1;white-space:nowrap;
    }
    .pill .dot{width:calc(var(--pill-h)*.34);height:calc(var(--pill-h)*.34);border-radius:50%;background:var(--pill-dot)}

    .kpi{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}
    .kpi .box{border:1px solid var(--border);border-radius:12px;padding:12px;background:var(--surface)}

    .video-guide .video-container{position:relative;padding-top:56.25%;border-radius:12px;overflow:hidden;border:1px solid var(--border);background:var(--surface)}
    .video-guide iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

    .form{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:10px}
    .form .full{grid-column:1 / -1}
    label{display:block;font-size:.9rem;margin-bottom:6px}
    select{font:inherit}
    input,select,button{
      color:var(--text);width:100%;padding:8px 10px;min-height:34px;border-radius:10px;background:var(--input-bg);
      border:1px solid var(--input-border);outline:none;transition:border .15s,box-shadow .15s,transform .02s,background .15s;
    }
    input:focus,select:focus{border-color:var(--brand);box-shadow:0 0 0 4px var(--ring)}

    .btn-primary{
      min-height:36px;padding:8px 12px;background:linear-gradient(180deg,var(--accent-1),var(--accent-2));
      border:1px solid var(--accent-border);color:var(--btn-text);font-weight:700;letter-spacing:.1px;cursor:pointer;
    }
    .btn-primary:hover{filter:brightness(1.04)}
    .btn-primary:active{transform:translateY(1px)}

    .btn-ghost{
      min-height:32px;padding:6px 10px;display:inline-flex;align-items:center;gap:6px;background:transparent;border:1px solid var(--border);
      color:var(--text);border-radius:10px;font-size:.88rem;justify-content:center;text-align:center;cursor:pointer;
    }
    [data-theme="dark"] .btn-ghost:hover{background:rgba(255,255,255,.06)}
    .btn-ghost:hover{background:rgba(0,0,0,.04)}

    .result{margin-top:12px;display:none}
    .summary{
      display:grid;grid-template-columns:1fr;gap:8px;padding:12px;border-radius:12px;
      background:linear-gradient(180deg,rgba(79,124,255,.1),rgba(79,124,255,.03));border:1px solid #c7d3ff;
    }
    .summary .line{display:flex;align-items:center;justify-content:space-between;font-size:1rem}
    .summary .value{font-size:1.4rem;font-weight:700}
    .summary .value_small{font-size:1rem;font-weight:500}

    .detail{display:grid;gap:6px;padding:10px;margin-top:10px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
    .detail .row{display:flex;align-items:flex-start;justify-content:space-between}
    .detail .label{color:var(--muted); padding-top:10px;}

    .unit-toggle{display:flex;justify-content:flex-end;margin-top:8px}
    .unit{display:inline-flex;justify-content:center; align-items:center;gap:8px;cursor:pointer;padding:6px 10px;border-radius:10px;background:var(--bg);border:1px solid var(--border)}
    .unit:focus{outline:none;box-shadow:0 0 0 4px var(--ring)}

    .collapse{border:1px solid var(--details-border);background:var(--details-bg);border-radius:12px;overflow:clip;}
    .collapse summary{
      cursor:pointer;padding:12px 14px;list-style:none;user-select:none;display:flex;align-items:center;justify-content:space-between;
    }
    .collapse summary::-webkit-details-marker{display:none}
    .collapse .caret{transition:transform .2s ease}
    .collapse[open] .caret{transform:rotate(90deg)}
    .collapse .content{padding:0 14px 14px 14px;animation:slideDown .25s ease}

    #faq > .collapse { margin: 0; }
    #faq > .collapse + .collapse { margin-top: 10px; }

    .related,.posts{display:grid;gap:10px;grid-template-columns:repeat(2,1fr)}
    .rcard,.p-card{
      display:block;padding:10px;border-radius:10px;background:var(--surface);border:1px solid var(--border);text-decoration:none;color:var(--text);
      transition:transform .05s ease;
    }
    .rcard:hover,.p-card:hover{transform:translateY(-1px)}
    .rcard h4,.p-card h4{margin:8px 0 4px 0;font-size:1rem}
    .rcard p{margin:0;color:var(--muted);font-size:.93rem}
    .p-thumb{aspect-ratio:16/9;width:100%;height:140px;object-fit:cover;border-radius:10px;border:1px solid var(--border);margin-bottom:6px}

    .rel-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
    .rel-card{display:block;border:1px solid var(--border);border-radius:12px;background:var(--surface);padding:12px;text-decoration:none;color:var(--text)}
    .rel-thumb{aspect-ratio:16/9;width:100%;height:140px;border:1px solid var(--border);border-radius:10px;object-fit:cover}

    .btn-row{display:flex;flex-wrap:wrap;gap:8px}
    .btn-row.two{
      display:grid; grid-template-columns:repeat(2, minmax(0, 2fr)); gap:8px; align-items:stretch; margin-bottom: 8px ;
    }
    .btn-row.two > button{width:100%}
    .btn-row.two .share-row{ grid-column: 1 / -1; justify-content: center; }
    .share-row{
      display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:center;
      flex:1 0 100%; margin:10px 0 0 0;
    }
    .icon-btn{
      width:40px; height:40px; display:inline-flex; align-items:center; justify-content:center;
      padding:0; line-height:0; cursor:pointer;
      border-radius:10px; border:1px solid var(--border); background:var(--surface);
    }
    button.icon-btn{ width:40px; min-width:40px; background:var(--surface) }
    .icon-btn img,.icon-btn svg{ width:22px; height:22px; display:block }
    .icon-btn:focus-visible{ outline:2px solid var(--ring); outline-offset:2px }
    .icon-btn.brand{ border:0 }
    .icon-btn.brand.x{ background:#111 }
    .icon-btn.brand.threads{ background:#000 }
    .icon-btn.brand.fb{ background:#1877F2 }
    .icon-btn.brand.naver{ background:#03C75A }
    [data-theme="dark"] .icon-btn{ background:var(--surface) }

    .chart-wrap{border:1px solid var(--border);border-radius:12px;padding:12px;background:var(--surface)}
    .chart-wrap figcaption{ text-align: center; }

    .compare-table{width:100%;border-collapse:collapse}
    .compare-table th,.compare-table td{border:1px solid var(--border);padding:8px;text-align:center}
    .compare-table th:first-child,.compare-table td:first-child{text-align:left}

    .mini-input{display:inline-flex;gap:8px;align-items:center;flex-wrap:wrap}
    .mini-input input{width:110px}

    .key-box{border:1px solid var(--border);border-radius:12px;padding:12px;background:var(--surface)}

    .sr-only{left:-9999px;top:auto}
    #grid2-result{scroll-margin-top:72px}
    #grid2-result .scenario-list{ display:flex; flex-direction:column; gap:10px; }
    #grid2-result .scenario-list > *{ width:100%; }
    #grid2-result .chart-wrap figure{ display: flex; flex-direction: column; align-items: center; }

    .waste-sim .fields{ display:grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap:8px; align-items:end; }
    .waste-sim .fields .i{ display:flex; flex-direction:column; }
    .waste-sim .fields input{ height:42px; }
    #btnWasteRun{ height:42px; padding:0 0px; transform:translateY(-7px) }
    #btnWasteRun{
      background:linear-gradient(180deg, var(--accent-1), var(--accent-2)); border:1px solid var(--accent-border);
      color:var(--btn-text); font-weight:700; }
    .waste-sim .kpis{ display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin-top:8px; }
    .waste-sim .kpi-card{
      display:flex; align-items:center; justify-content:space-between; padding:10px;
      border:1px solid var(--border); border-radius:10px; background:var(--surface); min-height:42px;
    }
    .waste-sim .kpi-card .kpi-k{ color:var(--muted); }
    .waste-sim .kpi-card .kpi-v{ font-weight:700; }
    #detail-guide { scroll-margin-top: 72px; }
    #detail-guide .content { overflow-x: hidden; }
    #detail-guide .content table { display:block; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
    #detail-guide .content img,
    #detail-guide .content canvas,
    #detail-guide .content iframe { max-width:100%; height:auto; display:block; }
    #detail-guide nav { display:flex; flex-wrap:wrap; gap:8px; }
    #detail-guide nav a { overflow-wrap:anywhere; }
    #detail-guide .content figure.ill{ display:flex; flex-direction:column; align-items:center; margin:12px auto; text-align:center; }
    #detail-guide .content figure.ill img{ display:block; margin:0 auto; max-width:100%; height:auto; border-radius:10px; border:1px solid var(--border); }
    #detail-guide .content figure.ill figcaption{ margin-top:6px; color:var(--muted); line-height:1.4; }
    #detail-guide .content .compare-table{ display: block; width: max-content !important; margin: 8px auto !important; }

    .skip-link:focus{top:12px; left:12px}
    .skip-link:focus, .skip-link:focus-visible{outline:2px solid #4f7cff; outline-offset:2px}
    .skip-link{position:absolute; top:-1000px; left:0; padding:8px 12px; background:#fff; border:1px solid #e5e7eb; border-radius:8px; z-index:1000; }

    @keyframes slideDown{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
    @media (min-width:1600px){body{background-position:center top}}
    @media (min-width:1024px){
      .wrap{width:min(100vw,var(--desk-w));max-width:var(--desk-w);margin-left:auto;margin-right:auto}
      html,body{overflow-x:hidden}
      .card{max-width:100%}
      .compare-table,.chart-wrap{overflow:auto}
      .wrap{min-height:min(100vh,var(--desk-h))}
      .grid{align-items:start}
    }
    @media (max-width:1023px){
      .breadcrumb{flex-wrap:wrap; font-size:.9rem}
      .brandbar img{height:55px; width:auto; transform:translateY(-4px); margin-right:1px}
      .top-actions.t-inline{margin-left:auto}
      .desktop-only{display:none}
      .mobile-only{display:inline}
      .tc-row{grid-template-columns:1fr}
      .tc-left a{font-size: 0.8rem};
      .tc-right{justify-content:flex-start}
      .tc-blob{max-width:180px}
      :root{ --hero-img-opacity: .18; }
      .grid{grid-template-columns:1fr;gap:12px}
      .calc-col{order:1}
      .main-col{order:2}

      #detail-guide nav{ display:flex; flex-wrap:wrap; gap:8px; }
      #detail-guide .content .ill img,
      #detail-guide .content img{ max-width:100%; height:auto; display:block; margin:8px auto; }
      #detail-guide .content table{ display:block; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch;}
      html, body{ overflow-x:hidden; }
      #detail-guide .content .ill{ text-align:center; }
      #detail-guide .content .ill figcaption{ color:var(--muted); font-size:.9rem; margin-top:6px; }

      .btn-row.two .share-row{ grid-column: 1 / -1; }
      .tc-sub{
        display: none;
      }
    }
    @media (max-width:480px){
      .title-card{border-radius:14px}
      .title-card h1{font-size: 1.3rem;}
      .tc-blob{max-width:150px}
      .btn-row.two{ grid-template-columns:1fr }
      .waste-sim .fields{ grid-template-columns:1fr; }
      .waste-sim .kpis{ grid-template-columns:1fr; }
      .hero .kpi{ grid-template-columns: 1fr; }
      .posts{ grid-template-columns: 1fr; }
      .wrap{ padding:10px 6px; padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
      .top-actions .lang-toggle .txt{ display:none; }
      .top-actions [data-theme-toggle] .txt{ display:none; }
      .top-actions .ico{ display:inline-block; line-height:1; vertical-align:middle; }
      .top-actions [data-theme-toggle]{
    margin-left:-3px;
  }
    }


    #howto, #howto-detail{ margin-top:16px; }
    #howto h2, #howto-detail h2{ font-size:1.1rem; margin:0 0 8px 0; }

    .howto-list{
      list-style:none; margin:0; padding:0;
      display:grid; grid-template-columns:1fr 1fr; gap:12px;
    }
    .howto-item{
      display:flex; align-items:flex-start; gap:10px;
      padding:12px; border:1px solid var(--border);
      border-radius:12px; background:var(--surface);
    }
    .step-badge{ width:28px; height:28px; aspect-ratio:1/1; flex:0 0 28px; display:grid; place-items:center; border-radius:50%;
      border:1px solid var(--border); font-weight:700; line-height:1; font-variant-numeric: tabular-nums;
    }
    .step-body h3{ margin:0 0 4px 0; font-size:1rem; }
    .step-body p{ margin:0; color:var(--muted); }

    #howto .btn-row{ margin-top:10px; }
    #howto .howto-list { list-style: none; padding-left: 0; }
    #howto .howto-list > li { list-style: none; }
    #howto .howto-list > li::marker { content: ""; }

    @media (max-width: 1023px){
      #howto .howto-item .step-badge{ display:none; }
      #howto .howto-item{ gap:6px; }
      .howto-list{ grid-template-columns:1fr; }
    }


    .chart-frame{ position:relative; width:100%; height:260px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
    #calorie-result .chart-wrap figure{ display:block; }
    .chart-wrap figure{ margin:0; }
    .chart-frame canvas{ position:absolute; inset:0; width:100% !important; height:100% !important; }
    .chart-legend{ display:flex; flex-direction:row; gap:8px 12px; margin-top:6px; align-self:stretch;
      align-items:center; flex-wrap:wrap; justify-content:flex-start; color:var(--muted); width:100%;
    }
    .chart-legend .item{
      display:inline-flex; align-items:center; gap:6px; box-shadow:none;
      border:none; border-radius:999px; padding:2px 10px; background:transparent; width:auto; flex:0 0 auto;
    }

    .chart-legend .key{
      display:inline-flex; align-items:center; justify-content:center; place-items:center;
      width:22px; height:22px; border-radius:50%; background:var(--pill-bg); color:var(--pill-text); font-weight:700;
      place-content:center; border:1px solid var(--pill-border); font:700 12px/1 ui-sans-serif, system-ui, -apple-system;
    }
    .chart-legend .name{
        flex:1; font-size:.9rem; font-weight:600; color:var(--text);
        max-width:18ch; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
      }
    .chart-legend .pct{ font-size:.85rem; color:var(--muted); }

    .ing-card{border:1px solid var(--border);border-radius:12px;padding:10px 12px;background:var(--surface);display:flex;justify-content:space-between;align-items:center}
    .ing-meta .name{font-weight:700}
    .ing-meta .dims{font-size:.92rem;color:var(--muted);margin-top:2px}
    .ing-btns{display:flex;gap:6px}

    .modal{background:rgba(0,0,0,.35);z-index:1000}
    .modal[open]{display:flex}
    .modal-card{width:min(560px,92vw);background:var(--surface);color:inherit;border:1px solid var(--border);border-radius:14px;padding:16px;box-shadow:var(--shadow)}
    .modal-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
    .modal-grid .full{grid-column:1 / -1}
    .modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
    .btn-secondary{min-height:32px;padding:6px 10px;border:1px solid var(--border);border-radius:10px;background:transparent;color:var(--text);cursor:pointer}

    .data-block{border:1px solid var(--border);border-radius:12px;padding:12px;background:var(--surface)}
    .data-table{width:100%;border-collapse:collapse}
    .data-table th,.data-table td{border:1px solid var(--border);padding:8px;text-align:center}
    .data-table th:first-child,.data-table td:first-child{text-align:center}

    #out-notes{ display:block; width:100%; padding:10px 12px; margin-top:4px; border:0; border-radius:12px; line-height:1.6;
      white-space:pre-line; text-align:right; word-break:keep-all; overflow-wrap:anywhere;
    }

    .bar-metric-buttons{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px;}
    .bar-metric-buttons .btn-ghost{flex: 0 0 auto;}


    .detail .row, .summary .line { align-items: center; }
    .detail .row > *, .summary .line > * { align-self: center; }
    .detail .row > span:last-child, .summary .line .value { line-height: 1.2; display: flex; align-items: center; }
    .chart-legend .item{ display:flex; align-items:center; gap:8px; width:100%; }
    .chart-legend .key{ flex:0 0 auto; }
    .chart-legend .name{ flex:1 1 auto; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .chart-legend .pct{ flex:0 0 auto; margin-left:auto; white-space:nowrap; text-align:right; }

    .hint-row{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:8px}
    .hint-card{border:1px solid var(--border); border-radius:10px; padding:10px; background:var(--surface); font-size:.95rem}
    .hint-card strong{display:block; margin-bottom:2px}
    .badge-mini{display:inline-flex; align-items:center; gap:6px; font-weight:700; font-size:.85rem; padding:2px 8px; border-radius:999px; background:var(--pill-bg); border:1px solid var(--pill-border); color:var(--pill-text)}
    .guide-lead{font-size:1.02rem}
    .guide-grid{grid-template-columns:1fr 1fr}
    .guide-grid .data-block{height:100%}
    @media (max-width:1023px){
      .hint-row{grid-template-columns:1fr}
      .guide-grid{grid-template-columns:1fr}
    }
    .mini-help{font-size:.9rem;color:var(--muted);margin-top:4px}
    .mini-box{border:1px dashed var(--border);border-radius:12px;padding:10px;background:var(--surface)}
    .mini-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
    .mini-out{display:flex;justify-content:space-between;gap:8px;margin-top:6px}
    .mini-out strong{font-weight:700}
    @media (max-width:480px){ .mini-row{grid-template-columns:1fr} }

    .ratio-chip{display:inline-flex;align-items:center;gap:6px;font-weight:700;font-size:.85rem;padding:2px 8px;border-radius:999px;background:var(--pill-bg);border:1px solid var(--pill-border);color:var(--pill-text)}
    .ratio-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}

    .formula-box{ border:1px dashed var(--border); border-radius:12px; padding:10px 12px; background:var(--surface); font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; line-height:1.5; white-space:pre-wrap; margin-top:8px; }
    .diagram-wrap{ display:flex; flex-direction:column; align-items:center;  justify-content:center; overflow:visible;}
    #circle-svg{ display:block; margin:0 auto; flex:0 0 auto;}

    #coursesContainer{ display:flex; flex-direction:column; gap:10px; margin-top:6px;}
    .course-input{ border:1px solid var(--border); border-radius:12px; padding:10px 12px; background:var(--surface);}
    .course-input .form-row{ display:grid; grid-template-columns:2.5fr 1fr 1fr auto; gap:8px; align-items:end; }
    .course-input .form-group:last-child{ align-self:end; }
    .btn-remove-course{ width:100%; min-height:32px; color: rgb(238, 173, 173); }
    @media (max-width:768px){ .course-input .form-row{ grid-template-columns:1fr 1fr; }}

    input:disabled, select:disabled, textarea:disabled { background-color: #f3f3f3; color: #777; border-color: #ddd; cursor: not-allowed; box-shadow: none; }

.top-actions .ico{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  height:16px;
  line-height:1;
}

.ico-svg{
  width:16px;
  height:16px;
  display:block;
}

.globe-ico{
  color:#3b82f6;
}

.theme-ico{
  color:#f4b400;
}


* { box-sizing: border-box; }
  html { scroll-behavior: smooth; }

  :root {
    color-scheme: light;
    --gh-canvas: #ffffff;
    --gh-canvas-subtle: #f6f8fa;
    --gh-canvas-inset: #f6f8fa;
    --gh-border: #d0d7de;
    --gh-border-muted: #d8dee4;
    --gh-fg: #1f2328;
    --gh-muted: #59636e;
    --gh-accent: #0969da;
    --gh-accent-subtle: #ddf4ff;
    --gh-header: #1f2937;
    --gh-shadow: 0 8px 24px rgba(140, 149, 159, 0.18);
    --bg: var(--gh-canvas);
    --surface: var(--gh-canvas);
    --text: var(--gh-fg);
    --muted: var(--gh-muted);
    --border: var(--gh-border);
    --brand: var(--gh-accent);
    --panel: var(--gh-canvas);
    --panel-strong: var(--gh-canvas);
    --panel-soft: var(--gh-canvas-subtle);
    --line: var(--gh-border);
    --line-strong: color-mix(in oklab, var(--gh-border), var(--gh-fg) 28%);
    --ink-strong: var(--gh-fg);
    --ink-soft: var(--gh-muted);
    --brand-soft: var(--gh-accent-subtle);
    --brand-strong: var(--gh-accent);
    --shadow-md: var(--gh-shadow);
    --shadow-lg: 0 16px 40px rgba(140, 149, 159, 0.22);
    --radius-xl: 16px;
  }

  [data-theme="dark"] {
    color-scheme: dark;
    --gh-canvas: #0d1117;
    --gh-canvas-subtle: #161b22;
    --gh-canvas-inset: #010409;
    --gh-border: #30363d;
    --gh-border-muted: #21262d;
    --gh-fg: #e6edf3;
    --gh-muted: #8b949e;
    --gh-accent: #2f81f7;
    --gh-accent-subtle: rgba(56, 139, 253, 0.14);
    --gh-header: #010409;
    --gh-shadow: 0 8px 24px rgba(1, 4, 9, 0.38);
    --bg: var(--gh-canvas);
    --surface: var(--gh-canvas);
    --text: var(--gh-fg);
    --muted: var(--gh-muted);
    --border: var(--gh-border);
    --brand: var(--gh-accent);
    --panel: var(--gh-canvas);
    --panel-strong: color-mix(in oklab, var(--gh-canvas), white 4%);
    --panel-soft: var(--gh-canvas-subtle);
    --line: var(--gh-border);
    --line-strong: color-mix(in oklab, var(--gh-border), white 18%);
    --ink-strong: var(--gh-fg);
    --ink-soft: var(--gh-muted);
    --brand-soft: var(--gh-accent-subtle);
    --brand-strong: var(--gh-accent);
    --shadow-md: var(--gh-shadow);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.45);
  }

  button,
  input {
    font: inherit;
  }

  .intro {
    text-align: left;
    color: var(--muted);
    font-size: 1.08rem;
    margin: 0 0 1rem;
    max-width: 880px;
    line-height: 1.62;
  }
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .shell,
  .search-stage,
  .guide-card,
  .hub-card,
  .popular-card,
  .library-card,
  .content-card,
  .faq-item,
  .footer-shell,
  .modal-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .home-main {
    display: grid;
    gap: 14px;
    margin-top: 16px;
  }

  .shell {
    border-radius: var(--radius-xl);
    padding: 16px;
  }

  .section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
  }

  .section-kicker {
    margin: 0 0 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
  }

  .section-head h2 {
    margin: 0;
    font-size: clamp(1rem, 1.4vw, 1.6rem);
    line-height: 1.16;
    letter-spacing: -0.03em;
    color: var(--ink-strong);
  }

  .section-head p {
    max-width: 920px;
    margin: 8px 0 0;
    color: var(--ink-soft);
    font-size: 0.97rem;
    line-height: 1.68;
  }

  .search-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(280px, 0.68fr);
    gap: 14px;
    border-radius: var(--radius-xl);
    padding: 16px;
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .search-title {
    margin: 12px 0 8px;
    color: var(--ink-strong);
    font-size: clamp(1rem, 1.4vw, 1.6rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
  }

  .search-copy {
    margin: 0 0 14px;
    color: var(--ink-soft);
    font-size: 0.97rem;
    line-height: 1.68;
    max-width: 760px;
  }

  .search-stack {
    display: grid;
    gap: 8px;
  }

  .search-frame {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  }

  .search-frame:focus-within {
    border-color: color-mix(in oklab, var(--brand), white 20%);
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand), transparent 84%);
    transform: translateY(-1px);
  }

  .search-ico {
    position: absolute;
    left: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--brand);
    pointer-events: none;
  }

  .search-ico svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
    stroke-width: 2.15;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  #homepageSearch,
  .search-frame input[type="search"] {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink-strong);
    font-size: 1rem;
    padding: 15px 16px 15px 58px;
  }

  #homepageSearch::placeholder,
  .search-frame input[type="search"]::placeholder {
    color: color-mix(in oklab, var(--ink-soft), transparent 14%);
  }

  .search-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 0.84rem;
  }

  .search-meta span {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
  }

  .result-popover {
    display: none;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }

  .result-popover.is-open {
    display: block;
  }

  .result-list {
    max-height: min(420px, 52vh);
    overflow-y: auto;
    padding: 6px;
  }

  .result-item,
  .result-empty {
    display: block;
    width: 100%;
    border-radius: 14px;
    padding: 11px 12px;
  }

  .result-item {
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  }

  .result-item strong {
    display: block;
    color: var(--ink-strong);
    font-size: 0.98rem;
    line-height: 1.36;
  }

  .result-item span,
  .result-empty {
    display: block;
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.48;
  }

  .result-item:hover,
  .result-item.is-active {
    background: var(--brand-soft);
    border-color: color-mix(in oklab, var(--brand), transparent 72%);
    transform: translateY(-1px);
  }

  [data-site-search] .result-popover {
    display: none;
    position: relative;
    z-index: 30;
    width: 100%;
    margin-top: 2px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }

  [data-site-search] .result-popover.is-open {
    display: block;
  }

  [data-site-search] .result-list {
    display: grid;
    gap: 4px;
    max-height: min(360px, 50vh);
    overflow-y: auto;
    padding: 6px;
  }

  [data-site-search] .result-item,
  [data-site-search] .result-empty {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    text-align: left;
    text-decoration: none;
    box-shadow: none;
    transform: none;
  }

  [data-site-search] .result-item strong {
    display: block;
    color: var(--ink-strong);
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.32;
  }

  [data-site-search] .result-item span,
  [data-site-search] .result-empty {
    display: block;
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: .8rem;
    line-height: 1.45;
  }

  [data-site-search] .result-item:hover,
  [data-site-search] .result-item:focus-visible,
  [data-site-search] .result-item.is-active {
    border-color: color-mix(in oklab, var(--brand), transparent 72%);
    background: var(--brand-soft);
    color: inherit;
    outline: none;
    transform: none;
  }

  .hero-rail {
    display: grid;
    gap: 10px;
    align-content: start;
  }

  .rail-card {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, color-mix(in oklab, var(--panel-soft), white 10%), var(--panel-strong));
    border: 1px solid var(--line);
    min-width: 0;
  }

  .rail-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--ink-strong);
    letter-spacing: -0.02em;
  }

  .rail-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-box {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
  }

  .metric-box span {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-soft);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
  }

  .metric-box strong {
    display: block;
    color: var(--ink-strong);
    font-size: 1.34rem;
    line-height: 1;
    letter-spacing: -0.03em;
  }

  #categoryStatsGrid .metric-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  #categoryStatsGrid .metric-box span {
    min-width: 0;
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  #categoryStatsGrid .metric-box strong {
    font-size: 1rem;
    white-space: nowrap;
  }

  .hub-grid,
  .popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
  }

  .hub-card,
  .popular-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }

  .hub-card:hover,
  .popular-card:hover,
  .library-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in oklab, var(--brand), transparent 66%);
    box-shadow: var(--shadow-lg);
  }

  .card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .card-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--brand);
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .card-count {
    color: var(--ink-soft);
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .hub-card h3,
  .popular-card h3,
  .library-card h3,
  .content-card h3,
  .faq-item h3 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 1rem;
    line-height: 1.34;
    letter-spacing: -0.02em;
  }
   .content-card h3{margin-bottom: 5px;}

  .hub-card p,
  .popular-card p,
  .library-card p,
  .content-card p,
  .faq-item p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.62;
  }

  .reference-card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 40 / 21;
    border: 1px solid var(--line);
    border-radius: 6px;
    object-fit: contain;
    background: var(--panel-soft);
  }

  .card-linkrow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
  }

  .mini-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
  }

  .library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .library-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    min-width: 0;
    height: 100%;
  }

  .library-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
  }

  .library-head > div:first-child {
    min-width: 0;
    flex: 1;
  }

  .library-head h3 {
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .count-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .preview-stack {
    display: grid;
    gap: 8px;
    align-content: start;
    flex: 1 1 auto;
  }

  .preview-link {
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid var(--line);
    background: color-mix(in oklab, var(--panel-soft), white 8%);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  }

  .preview-link:hover {
    border-color: color-mix(in oklab, var(--brand), transparent 68%);
    background: var(--brand-soft);
    transform: translateY(-1px);
  }

  .preview-link strong {
    color: var(--ink-strong);
    font-size: 0.94rem;
    line-height: 1.36;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .preview-link small {
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 2px;
  }

  .card-actions span {
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .guide-grid,
  .text-columns,
  .faq-grid {
    display: grid;
    gap: 12px;
  }

  .guide-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .guide-card {
    border-radius: 18px;
    padding: 14px;
  }

  .guide-step {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 10px;
  }

  .guide-card h3 {
    margin: 0 0 8px;
    color: var(--ink-strong);
    font-size: 1rem;
    letter-spacing: -0.02em;
  }

  .guide-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .text-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-card,
  .faq-item {
    border-radius: 18px;
    padding: 14px;
  }

  .content-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-soft);
    line-height: 1.7;
  }

  .content-card li + li {
    margin-top: 6px;
  }

  .faq-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .faq-item {
    display: grid;
    gap: 8px;
  }

  .footer {
    margin-top: 16px;
  }

  .footer-shell {
    border-radius: var(--radius-xl);
    padding: 16px;
  }

  .footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }

  .footer-brand h2 {
    margin: 0 0 8px;
    color: var(--ink-strong);
    font-size: 1.18rem;
    letter-spacing: -0.02em;
  }

  .footer-brand p {
    max-width: 760px;
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.68;
    font-size: 0.95rem;
  }

  .footer-statgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .footer-bottom {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding-top: 14px;
  }

  .footer-col h3 {
    margin: 0 0 10px;
    color: var(--ink-strong);
    font-size: 0.95rem;
    letter-spacing: -0.02em;
  }

  .footer-links,
  .footer-meta {
    display: grid;
    gap: 8px;
  }

  .footer-link,
  .footer-meta a {
    text-decoration: none;
    color: var(--ink-soft);
    transition: color 0.18s ease;
  }

  .footer-link:hover,
  .footer-meta a:hover {
    color: var(--brand);
  }

  .footer-meta span {
    color: var(--ink-soft);
    line-height: 1.55;
    font-size: 0.9rem;
  }

  .footer-copyright {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(8, 15, 28, 0.56);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
  }

  .modal.is-open {
    display: flex;
  }

  .modal-panel {
    width: min(1080px, 100%);
    max-height: min(90dvh, 920px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 24px;
    overflow: hidden;
    background:
      radial-gradient(circle at top right, color-mix(in oklab, var(--brand), transparent 86%) 0%, transparent 28%),
      linear-gradient(180deg, color-mix(in oklab, var(--panel-strong), white 4%), var(--panel));
    box-shadow: var(--shadow-lg);
  }

  .modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex: none;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in oklab, var(--panel), white 2%);
  }

  .modal-overline {
    margin: 0 0 6px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .modal-head h2 {
    margin: 0 0 8px;
    color: var(--ink-strong);
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.14;
    letter-spacing: -0.03em;
  }

  .modal-head p {
    max-width: 760px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.66;
  }

  .modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }

  .modal-meta span,
  .modal-meta a {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--ink-soft);
    font-size: 0.82rem;
    text-decoration: none;
  }

  .modal-close {
    border: 0;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--panel-soft), white 4%);
    color: var(--ink-soft);
    cursor: pointer;
    flex: none;
    font-size: 1.25rem;
    line-height: 1;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  }

  .modal-close:hover {
    background: var(--brand-soft);
    color: var(--brand);
    transform: rotate(90deg);
  }

  .modal-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 18px 22px 28px;
    overscroll-behavior: contain;
    scroll-padding-bottom: 28px;
  }

  .modal-groups {
    display: grid;
    gap: 16px;
  }

  .modal-group {
    display: grid;
    gap: 10px;
  }

  .modal-group h3 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 0.95rem;
    letter-spacing: -0.02em;
  }

  .modal-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .modal-link {
    display: grid;
    gap: 5px;
    padding: 12px 13px;
    border-radius: 16px;
    text-decoration: none;
    border: 1px solid var(--line);
    background: color-mix(in oklab, var(--panel-soft), white 8%);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  }

  .modal-link:hover {
    border-color: color-mix(in oklab, var(--brand), transparent 68%);
    background: var(--brand-soft);
    transform: translateY(-1px);
  }

  .modal-link strong {
    color: var(--ink-strong);
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .modal-link small {
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .loading-card {
    padding: 14px;
    border-radius: 18px;
    border: 1px dashed var(--line);
    color: var(--ink-soft);
    background: var(--panel-soft);
  }

  @media (max-width: 1024px) {
    .calculator-suggestion-list button,
    .calculator-suggestion-button {
      font-weight: 400;
    }

    .footer-bottom .footer-col:nth-child(2) {
      display: none;
    }


    .footer-meta span {
      display: none;
    }
    .footer-bottom .footer-col:nth-child(2) {
      display: none;
    }
    .search-stage,
    .footer-top,
    .footer-bottom,
    .text-columns {
      grid-template-columns: 1fr;
    }

    .guide-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .faq-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 720px) {
    #calculatorForm {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
    }

    #calculatorForm .calculator-field.full {
      grid-column: 1 / -1;
    }
    .search-stage,
    .shell,
    .footer-shell {
      padding-left: 12px;
      padding-right: 12px;
    }

    .search-copy,
    .section-head p,
    .footer-brand p {
      font-size: 0.94rem;
    }

    .intro {
      font-size: 1rem;
      margin-bottom: .9rem;
    }

    .search-frame {
      min-height: 54px;
    }

    .search-ico {
      left: 14px;
      width: 32px;
      height: 32px;
    }

    .search-ico svg {
      width: 28px;
      height: 28px;
    }

    #homepageSearch,
    .search-frame input[type="search"] {
      padding: 14px 14px 14px 54px;
    }

    .faq-grid,
    .guide-grid,
    .modal-list {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .footer-statgrid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-top,
    .footer-bottom,
    .footer-tagline {
      display: none;
    }

    .footer-shell {
      padding-top: 14px;
      padding-bottom: 14px;
    }

    .footer-bottom {
      justify-items: center;
      text-align: center;
    }

    .footer-col {
      text-align: center;
    }

    .footer-links,
    .footer-meta {
      justify-items: center;
    }

    .footer-copyright {
      justify-content: center;
      text-align: center;
      margin-top: 0;
      padding-top: 0;
      border-top: 0;
      font-size: 0.82rem;
    }

    .hub-grid,
    .popular-grid,
    .library-grid {
      grid-template-columns: 1fr;
    }

    .library-card {
      min-height: 0;
    }

    .library-head {
      min-height: 0;
    }

    .card-actions {
      align-items: flex-start;
      flex-direction: column;
    }

    .modal {
      padding: 8px;
      align-items: flex-start;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    .modal-panel {
      width: min(100vw - 8px, 100%);
      height: auto;
      min-height: auto;
      max-height: none;
      border-radius: 22px;
    }

    .modal-head,
    .modal-scroll {
      padding-left: 12px;
      padding-right: 12px;
    }

    .modal-head {
      padding-top: 14px;
      padding-bottom: 12px;
    }

    .modal-scroll {
      flex: none;
      min-height: auto;
      overflow: visible;
      padding-top: 14px;
      padding-bottom: 22px;
    }
  }


  body {
    margin: 0;
    background: var(--gh-canvas);
    color: var(--gh-fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  }

  .wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .github-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 12px 24px;
    background: var(--gh-header);
    color: #f0f6fc;
  }

  .github-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 36px;
    border-radius: 1px;
    overflow: hidden;
    flex: none;

  }

  .github-mark img {
    width: auto;
    height: 56px;
    object-fit: contain;
  }

  .topbar-links {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
  }

  .topbar-links a,
  .repo-actions a {
    color: inherit;
    text-decoration: none;
  }

  .topbar-links a,
  .topbar-theme-button {
    font-weight: 600;
    font-size: 0.92rem;
  }

  .topbar-theme-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    line-height: inherit;
  }

  .topbar-theme-button:hover {
    color: inherit;
    text-decoration: none;
  }

  .topbar-menu-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 38px;
    margin-left: auto;
    border: 1px solid rgba(240, 246, 252, 0.22);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(240, 246, 252, 0.08), rgba(240, 246, 252, 0.02));
    color: #f0f6fc;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  }

  .topbar-menu-button:hover,
  .topbar-menu-button[aria-expanded="true"] {
    border-color: rgba(240, 246, 252, 0.42);
    background: rgba(240, 246, 252, 0.12);
    box-shadow: inset 0 0 0 1px rgba(240, 246, 252, 0.04);
  }

  .topbar-menu-button svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-menu-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 70px 10px 10px;
    background: rgba(1, 4, 9, 0.64);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .mobile-menu-modal.is-open {
    display: flex;
  }

  .mobile-menu-panel {
    display: flex;
    flex-direction: column;
    width: min(440px, 100%);
    max-height: calc(100dvh - 80px);
    min-height: 0;
    border: 1px solid var(--gh-border);
    border-radius: 10px;
    background: var(--gh-canvas);
    color: var(--gh-fg);
    box-shadow: 0 18px 44px rgba(1, 4, 9, 0.34);
    overflow: hidden;
    transform: translateY(-6px);
    animation: mobileMenuIn 0.16s ease forwards;
  }

  @keyframes mobileMenuIn {
    to {
      transform: translateY(0);
    }
  }

  .mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gh-border);
    background: var(--gh-canvas-subtle);
  }

  .mobile-menu-head h2 {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.3;
    letter-spacing: 0;
  }

  .mobile-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--gh-border);
    border-radius: 8px;
    background: var(--gh-canvas);
    color: var(--gh-muted);
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  }

  .mobile-menu-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
  }

  .mobile-menu-close:hover {
    border-color: var(--gh-accent);
    background: var(--gh-accent-subtle);
    color: var(--gh-accent);
  }

  .mobile-menu-links {
    display: grid;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 8px;
  }

  .mobile-menu-links a,
  .mobile-theme-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--gh-fg);
    background: transparent;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  }

  .mobile-menu-links a::after,
  .mobile-theme-button::after {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.52;
  }

  .mobile-menu-links a:hover,
  .mobile-theme-button:hover {
    border-color: var(--gh-border);
    background: var(--gh-canvas-subtle);
    color: var(--gh-accent);
  }

  .repo-hero {
    background: var(--gh-canvas);
    border-bottom: 1px solid color-mix(in oklab, var(--gh-border), transparent 35%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  }

  .repo-context,
  .repo-tabs,
  .home-main,
  .footer {
    width: min(1440px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
  }

  .repo-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 50px;
    padding: 6px 0 2px;
  }

  .repo-title {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    color: var(--gh-fg);
    font-size: 1.5rem;
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: 0;
  }

  .repo-title strong {
    color: var(--gh-fg);
    font-weight: 750;
  }

  .repo-title svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: currentColor;
  }

  .repo-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border: 1px solid var(--gh-border);
    border-radius: 999px;
    color: var(--gh-muted);
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.5;
  }

  .repo-subtitle {
    display: none;
  }

  .repo-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    flex: none;
  }

  .gh-button,
  .card-button,
  .modal-close {
    border-radius: 6px;
  }

  .gh-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid var(--gh-border);
    background: var(--gh-canvas);
    color: var(--gh-fg);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .gh-button.primary {
    border-color: var(--gh-accent);
    background: var(--gh-accent);
    color: #ffffff;
  }

  .gh-button.primary:hover {
    background: color-mix(in oklab, var(--gh-accent), black 12%);
  }

  .repo-tabs {
    position: relative;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0;
  }

  .repo-tab-indicator {
    position: absolute;
    left: 0;
    bottom: 0;
    width: var(--tab-indicator-width, 0px);
    height: 2px;
    border-radius: 999px 999px 0 0;
    background: var(--gh-accent);
    transform: translateX(var(--tab-indicator-left, 0px));
    transition: transform 0.18s ease, width 0.18s ease;
    pointer-events: none;
  }

  .repo-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 10px;
    border-bottom: 2px solid transparent;
    color: var(--gh-muted);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .repo-tabs a::before {
    content: '';
    width: 15px;
    height: 15px;
    flex: none;
    background: currentColor;
    mask: var(--repo-tab-icon) center / contain no-repeat;
    -webkit-mask: var(--repo-tab-icon) center / contain no-repeat;
  }

  .repo-tabs a:nth-of-type(1) {
    --repo-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 11 9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E");
  }

  .repo-tabs a:nth-of-type(2) {
    --repo-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2c1 4-2 5-2 8 0 2 1 3 2 3 2 0 3-2 2-5 3 2 5 5 5 8a7 7 0 0 1-14 0c0-3 2-6 5-8'/%3E%3C/svg%3E");
  }

  .repo-tabs a:nth-of-type(3) {
    --repo-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='6' height='6' rx='1'/%3E%3Crect x='14' y='4' width='6' height='6' rx='1'/%3E%3Crect x='4' y='14' width='6' height='6' rx='1'/%3E%3Crect x='14' y='14' width='6' height='6' rx='1'/%3E%3C/svg%3E");
  }

  .repo-tabs a:nth-of-type(4) {
    --repo-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h6a4 4 0 0 1 4 4v12a4 4 0 0 0-4-4H2z'/%3E%3Cpath d='M22 4h-6a4 4 0 0 0-4 4v12a4 4 0 0 1 4-4h6z'/%3E%3C/svg%3E");
  }

  .repo-tabs a:nth-of-type(n+5) {
    --repo-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9a3 3 0 1 1 5 2.2c-1.5 1-2.5 1.4-2.5 3.3'/%3E%3Cpath d='M12 18h.01'/%3E%3C/svg%3E");
  }

  .repo-tabs a.active {
    color: var(--gh-accent);
    font-weight: 600;
  }

  .repo-tabs a:hover,
  .repo-tabs a:focus-visible {
    color: var(--gh-accent);
    border-bottom-color: var(--gh-accent);
  }

  .repo-tabs .counter {
    display: none;
  }

  .home-main {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 16px;
    margin-top: 24px;
  }

  .search-stage,
  #browse-categories {
    grid-column: 1 / -1;
  }

  #featured-hubs,
  #popular-tools,
  #guided-paths,
  #homepage-depth,
  #homepage-faq {
    grid-column: 1;
  }

  .shell,
  .search-stage,
  .guide-card,
  .hub-card,
  .popular-card,
  .library-card,
  .content-card,
  .faq-item,
  .footer-shell,
  .modal-panel {
    border-color: var(--gh-border);
    border-radius: 6px;
    background: var(--gh-canvas);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .search-stage {
    grid-template-columns: minmax(0, 1fr) 420px;
    padding: 0;
    overflow: hidden;
    border-color: #dbe5f4;
    border-radius: 10px;
    background: #f8faff;
    box-shadow: 0 8px 24px rgba(31, 77, 152, 0.08);
  }

  .search-stage > div:first-child,
  .hero-rail {
    padding: 24px;
  }

  .search-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 40%);
    grid-template-areas:
      "copy art"
      "search art"
      "benefits benefits";
    gap: 18px 24px;
    min-width: 0;
    background: #fbfcff;
  }

  .search-hero-copy {
    grid-area: copy;
    align-self: end;
    min-width: 0;
  }

  .search-eyebrow {
    display: inline-flex;
    margin: 0 0 12px;
    padding: 5px 9px;
    border: 1px solid #dbe6ff;
    border-radius: 999px;
    background: #f1f5ff;
    color: #2667e8;
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1;
  }

  .search-hero-art {
    grid-area: art;
    display: grid;
    place-items: center;
    min-height: 250px;
  }

  .search-hero-art img {
    display: block;
    width: min(100%, 400px);
    max-height: 310px;
    object-fit: contain;
  }

  .search-hero .search-stack {
    grid-area: search;
    align-self: start;
    min-width: 0;
  }

  .hero-rail {
    border-left: 1px solid var(--gh-border);
    background: #f6f8fc;
  }

  .search-title {
    margin: 0 0 10px;
    color: #101936;
    font-size: 2.25rem;
    line-height: 1.12;
    letter-spacing: 0;
  }

  .search-title strong {
    color: #2868ed;
    font-weight: inherit;
  }

  .search-copy,
  .section-head p,
  .rail-card p,
  .hub-card p,
  .popular-card p,
  .library-card p,
  .content-card p,
  .faq-item p,
  .footer-brand p,
  .footer-meta span {
    color: var(--gh-muted);
  }

  .search-frame {
    min-height: 46px;
    border-color: var(--gh-border);
    border-radius: 6px;
    background: var(--gh-canvas);
    box-shadow: inset 0 1px 0 rgba(208, 215, 222, 0.2);
    transform: none;
  }

  .search-frame:focus-within {
    border-color: var(--gh-accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--gh-accent), transparent 78%);
    transform: none;
  }

  .search-ico,
  .section-kicker,
  .card-tag,
  .count-pill,
  .mini-chip,
  .modal-overline {
    color: var(--gh-accent);
  }

  .search-ico {
    left: 12px;
    width: 24px;
    height: 24px;
  }

  .search-ico svg {
    width: 18px;
    height: 18px;
  }

  #homepageSearch,
  .search-frame input[type="search"] {
    flex: 1 1 auto;
    width: auto;
    color: var(--gh-fg);
    min-width: 0;
    padding: 11px 8px 11px 42px;
    font-size: 0.95rem;
  }

  .search-meta span,
  .card-tag,
  .count-pill,
  .mini-chip,
  .modal-meta span,
  .modal-meta a {
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .result-popover,
  .rail-card,
  .metric-box,
  .preview-link,
  .modal-link,
  .loading-card {
    border-color: var(--gh-border);
    border-radius: 6px;
    background: var(--gh-canvas);
    box-shadow: var(--gh-shadow);
  }

  .rail-card,
  .metric-box,
  .preview-link,
  .modal-link,
  .loading-card {
    box-shadow: none;
  }

  .metric-box,
  .rail-card {
    background: var(--gh-canvas);
  }

  .hero-rail .metric-grid {
    gap: 9px;
  }

  .hero-rail .metric-box {
    position: relative;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 55px;
    padding: 8px 14px 8px 8px;
    border-color: #dfe6f2;
    border-radius: 8px;
  }

  .hero-rail .metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: #edf4ff;
    color: #3478ec;
    box-shadow: inset 0 0 0 1px #dce8ff;
  }

  .hero-rail .metric-box:nth-child(3n+2) .metric-icon {
    background: #f4efff;
    color: #8a60e8;
    box-shadow: inset 0 0 0 1px #e5dbff;
  }

  .hero-rail .metric-box:nth-child(3n) .metric-icon {
    background: #eff9ed;
    color: #56a94a;
    box-shadow: inset 0 0 0 1px #dcefd7;
  }

  .hero-rail .metric-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .hero-rail .metric-box > span:not(.metric-icon) {
    justify-self: start;
    width: 100%;
    margin: 0;
    color: #313b55;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    text-transform: none;
    text-align: left;
    overflow-wrap: normal;
    word-break: normal;
  }

  .hero-rail .metric-box strong {
    justify-self: start;
    margin-right: 4px;
    color: #111827;
    font-size: 0.95rem;
    line-height: 1;
  }

  .search-benefits {
    grid-area: benefits;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding-top: 16px;
    border-top: 1px solid #e5ebf4;
  }

  .search-benefits > div {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
    padding: 0 16px;
    border-left: 1px solid #e5ebf4;
  }

  .search-benefits > div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-weight: 800;
  }

  .benefit-icon.tone-blue { color: #2868ed; background: #edf4ff; }
  .benefit-icon.tone-orange { color: #ef8b19; background: #fff5e8; }
  .benefit-icon.tone-green { color: #28a56a; background: #ebf8f1; }

  .search-benefits p,
  .search-benefits strong,
  .search-benefits small {
    display: block;
    margin: 0;
  }

  .search-benefits strong {
    color: #283249;
    font-size: 0.76rem;
  }

  .search-benefits small {
    margin-top: 3px;
    color: #7a8499;
    font-size: 0.66rem;
  }

  .section-head {
    align-items: center;
    margin: -16px -16px 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gh-border);
    background: var(--gh-canvas-subtle);
  }

  .section-head h2,
  .hub-card h3,
  .popular-card h3,
  .library-card h3,
  .content-card h3,
  .faq-item h3,
  .rail-card h3,
  .footer-brand h2,
  .footer-col h3,
  .modal-head h2,
  .modal-group h3 {
    color: var(--gh-fg);
    letter-spacing: 0;
  }

  .section-kicker {
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.84rem;
  }

  .hub-grid,
  .popular-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .library-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  .hub-card,
  .popular-card,
  .library-card,
  .guide-card,
  .content-card,
  .faq-item {
    padding: 16px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
  }

  .hub-card:hover,
  .popular-card:hover,
  .library-card:hover,
  .preview-link:hover,
  .modal-link:hover,
  .result-item:hover,
  .result-item.is-active {
    transform: none;
    border-color: var(--gh-accent);
    background: var(--gh-canvas-subtle);
    box-shadow: none;
  }

  .card-button {
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    padding: 7px 12px;
    background: var(--gh-canvas-subtle);
    color: var(--gh-accent);
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  }

  .card-button:hover {
    border-color: var(--gh-accent);
    background: var(--gh-accent-subtle);
    color: var(--gh-accent);
    box-shadow: none;
    transform: none;
    filter: none;
  }

  .guide-step {
    border-radius: 6px;
    background: var(--gh-accent-subtle);
    color: var(--gh-accent);
  }

  .footer {
    margin-top: 16px;
    margin-bottom: 24px;
  }

  .footer-shell {
    background: var(--gh-canvas-subtle);
  }

  .footer-top,
  .footer-bottom,
  .footer-copyright,
  .modal-head {
    border-color: var(--gh-border);
  }

  .footer-link,
  .footer-meta a {
    color: var(--gh-accent);
  }

  .modal {
    background: rgba(1, 4, 9, 0.56);
  }

  .modal-panel {
    background: var(--gh-canvas);
    box-shadow: var(--gh-shadow);
  }

  .modal-head {
    background: var(--gh-canvas-subtle);
  }

  .modal-close {
    background: var(--gh-canvas);
    border: 1px solid var(--gh-border);
    color: var(--gh-muted);
  }

  .modal-close:hover {
    transform: none;
    background: var(--gh-canvas-subtle);
    color: var(--gh-fg);
  }


  .home-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    margin-top: 28px;
    margin-bottom: 40px;
  }

  .home-main > .search-stage,
  .home-main > .shell,
  .home-main > #browse-categories,
  .home-main > #featured-hubs,
  .home-main > #popular-tools,
  .home-main > #guided-paths,
  .home-main > #homepage-depth,
  .home-main > #homepage-faq {
    grid-column: 1 / -1;
  }

  .home-main > .shell {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .home-main .section-head {
    align-items: end;
    margin: 0 0 16px;
    padding: 0 0 14px;
    border-bottom: 1px solid color-mix(in oklab, var(--gh-border), transparent 20%);
    background: transparent;
  }

  .home-main .section-head h2 {
    font-size: 1.45rem;
    line-height: 1.2;
  }

  .home-main .section-head p {
    max-width: 780px;
    margin-top: 6px;
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .home-main .section-kicker {
    margin-bottom: 5px;
    color: var(--gh-accent);
    font-size: 0.75rem;
    font-weight: 750;
  }

  .home-main .hub-grid,
  .home-main .popular-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .home-main .library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .home-main .hub-card,
  .home-main .popular-card,
  .home-main .library-card,
  .home-main .guide-card,
  .home-main .content-card,
  .home-main .faq-item {
    border: 1px solid color-mix(in oklab, var(--gh-border), transparent 15%);
    border-radius: 8px;
    background: var(--gh-canvas);
    box-shadow: 0 4px 14px rgba(31, 55, 91, 0.05);
  }

  .home-main .hub-card,
  .home-main .popular-card {
    min-height: 184px;
    padding: 18px;
    gap: 12px;
  }

  .home-main .hub-card:hover,
  .home-main .popular-card:hover,
  .home-main .library-card:hover,
  .home-main .guide-card:hover,
  .home-main .content-card:hover,
  .home-main .faq-item:hover {
    border-color: color-mix(in oklab, var(--gh-accent), transparent 50%);
    background: var(--gh-canvas);
    box-shadow: 0 10px 24px rgba(31, 77, 152, 0.1);
    transform: translateY(-2px);
  }

  .home-main .hub-card h3,
  .home-main .popular-card h3,
  .home-main .library-card h3,
  .home-main .guide-card h3,
  .home-main .content-card h3,
  .home-main .faq-item h3 {
    font-size: 0.98rem;
    line-height: 1.4;
  }

  .home-main .hub-card p,
  .home-main .popular-card p,
  .home-main .library-card p,
  .home-main .guide-card p,
  .home-main .content-card p,
  .home-main .faq-item p {
    font-size: 0.84rem;
    line-height: 1.62;
  }

  .home-main .library-card {
    padding: 18px;
    gap: 12px;
  }

  .home-main .preview-stack {
    gap: 0;
    border-top: 1px solid var(--gh-border-muted);
  }

  .home-main .preview-link {
    padding: 10px 2px;
    border: 0;
    border-bottom: 1px solid var(--gh-border-muted);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .home-main .preview-link:hover {
    padding-left: 6px;
    border-color: var(--gh-border-muted);
    background: transparent;
    color: var(--gh-accent);
    transform: none;
  }

  .home-main .preview-link strong {
    font-size: 0.86rem;
  }

  .home-main .preview-link small {
    font-size: 0.74rem;
  }

  .home-main .card-actions {
    padding-top: 4px;
  }

  .home-main .card-actions span {
    font-size: 0.76rem;
  }

  .home-main .search-meta span,
  .home-main .count-pill,
  .home-main .mini-chip {
    position: relative;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .home-main .count-pill {
    padding: 2px 0 2px 13px;
  }

  .home-main .search-meta span,
  .home-main .mini-chip {
    padding: 2px 0 2px 13px;
  }

  .home-main .search-meta span::before,
  .home-main .count-pill::before,
  .home-main .mini-chip::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    transform: translateY(-50%);
    opacity: 0.75;
  }

  .home-main .guide-grid {
    gap: 14px;
  }

  .home-main .guide-card,
  .home-main .content-card,
  .home-main .faq-item {
    padding: 18px;
  }

  .home-main .reference-card-thumb {
    aspect-ratio: 40 / 21;
    border-radius: 6px;
  }

  @media (max-width: 1200px) {
    .home-main .hub-grid,
    .home-main .popular-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-main .library-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 900px) {
    .github-topbar {
      padding: 12px 16px;
    }

    .topbar-links {
      display: none;
    }

    .topbar-menu-button {
      display: inline-flex;
    }

    .repo-context {
      flex-direction: row;
    }

    .repo-actions {
      justify-content: flex-start;
    }

    .home-main,
    .search-stage {
      grid-template-columns: 1fr;
    }

    .search-hero {
      grid-template-columns: minmax(0, 1fr) 220px;
    }

    .hero-rail {
      border-left: 0;
      border-top: 1px solid var(--gh-border);
    }

    .home-main .hub-grid,
    .home-main .popular-grid,
    .home-main .library-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 720px) {
     .repo-tabs a {
      padding: 0 6px;
      font-size: 0.82rem;
      gap: 4px;
    }
    .repo-context{
       height: auto;
       min-height: 48px;
    }
    .repo-title {
      font-size: 1.4rem;
    }
    .repo-tabs,
    .home-main,
    .footer {
      width: min(100% - 20px, 1440px);
    }

    .search-stage > div:first-child,
    .hero-rail {
      padding: 16px;
    }

    .search-hero {
      grid-template-columns: 1fr;
      grid-template-areas:
        "copy"
        "art"
        "search"
        "benefits";
    }

    .search-hero-art {
      min-height: 140px;
    }

    .search-hero-art img {
      max-height: 170px;
    }

    .search-title {
      font-size: 1.85rem;
    }

    .search-benefits {
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .search-benefits > div,
    .search-benefits > div:first-child {
      padding: 0;
      border-left: 0;
    }

    .home-main {
      gap: 22px;
      margin-top: 20px;
    }

    .home-main .hub-grid,
    .home-main .popular-grid,
    .home-main .library-grid {
      grid-template-columns: 1fr;
    }

    .section-head {
      margin-left: -12px;
      margin-right: -12px;
      padding-left: 12px;
      padding-right: 12px;
    }
  }
 .github-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex: 0 0 auto;
}

.github-mark {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.github-mark img {
  display: block;
  width: auto;
  height: 56px;
  max-width: none;
  flex-shrink: 0;
}

.topbar-links-left {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 0px;
  flex: 0 0 auto;
}

.topbar-links-right {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 0px;
  flex: 0 0 auto;
}

.topbar-links-left a,
.topbar-links-right a {
  white-space: nowrap;
  text-decoration: none;
}

.mobile-menu-section {
  display: grid;
  gap: 3px;
}

.mobile-menu-section + .mobile-menu-section {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--gh-border);
}

.mobile-menu-label {
  padding: 3px 10px;
  color: var(--gh-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

@media (max-width: 900px) {
  .github-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
  }

  .topbar-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  .search-meta,
  .search-copy,
  .hero-rail,
  .topbar-links,
  .topbar-links-left,
  .topbar-links-right {
    display: none !important;
  }

  .topbar-menu-button {
    display: inline-flex !important;
    flex: 0 0 auto;
    margin-left: 12px;
  }

  .github-mark {
    min-width: 0;
  }

  .github-mark img {
    max-width: min(220px, calc(100vw - 96px));
    height: 50px;
    object-fit: contain;
  }
}

#categoryModal.modal {
  z-index: 120;
  align-items: flex-start;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: 70px 10px 10px;
  overflow: hidden;
  background: rgba(1, 4, 9, 0.64);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#categoryModal .modal-panel {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: calc(100dvh - 80px);
  min-height: 0;
  border: 1px solid var(--gh-border);
  border-radius: 10px;
  background: var(--gh-canvas);
  color: var(--gh-fg);
  box-shadow: 0 18px 44px rgba(1, 4, 9, 0.34);
  overflow: hidden;
  transform: translateY(-6px);
  animation: mobileMenuIn 0.16s ease forwards;
}

#categoryModal .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gh-border);
  background: var(--gh-canvas-subtle);
}

#categoryModal .modal-overline {
  margin: 0 0 4px;
  color: var(--gh-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

#categoryModal .modal-head h2 {
  margin: 0;
  color: var(--gh-fg);
  font-size: 0.98rem;
  line-height: 1.3;
  letter-spacing: 0;
}

#categoryModal .modal-head p {
  margin-top: 6px;
  color: var(--gh-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

#categoryModal .modal-meta {
  margin-top: 8px;
}

#categoryModal .modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--gh-border);
  border-radius: 8px;
  background: var(--gh-canvas);
  color: var(--gh-muted);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

#categoryModal .modal-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
}

#categoryModal .modal-close:hover {
  border-color: var(--gh-accent);
  background: var(--gh-accent-subtle);
  color: var(--gh-accent);
  transform: none;
}

#categoryModal .modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

#categoryModal .modal-groups {
  gap: 8px;
}

#categoryModal .modal-group {
  gap: 6px;
}

#categoryModal .modal-group h3 {
  padding: 3px 8px;
  color: var(--gh-muted);
  font-size: 0.78rem;
  letter-spacing: 0;
}

#categoryModal .modal-link {
  border-radius: 8px;
}

@media (max-width: 720px) {
  #categoryModal .modal-panel {
    width: min(440px, 100%);
  }
}


.notes-main {
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto 0;
}

.notes-main::before {
	content: "";
	position: fixed;
	left: 0;
	right: 0;
	top: 64px;
	height: 16px;
	z-index: 29;
	background: var(--gh-canvas);
	pointer-events: none;
}

.notes-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.notes-sidebar,
.notes-panel,
.notes-empty,
.notes-view,
.notes-editor {
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
}

.notes-sidebar {
  position: sticky;
  top: 80px;
  overflow: hidden;
}

.notes-sidebar-head,
.notes-panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gh-border);
  background: var(--gh-canvas-subtle);
}

.notes-sidebar-title,
.notes-panel-title {
  margin: 0;
  color: var(--gh-fg);
  font-size: 1rem;
  line-height: 1.35;
}

.notes-sidebar-copy,
.notes-panel-copy {
  margin: 6px 0 0;
  color: var(--gh-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.notes-sidebar-tools {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--gh-border);
}

.notes-search {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  outline: none;
  background: var(--gh-canvas);
  color: var(--gh-fg);
}

.notes-search:focus,
.notes-title-input:focus,
.notes-editor:focus {
  border-color: var(--gh-accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--gh-accent), transparent 78%);
}

.notes-tool-group {
  display: grid;
  gap: 8px;
}

.notes-tool-label {
  color: var(--gh-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.notes-button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.notes-button-grid.single {
  grid-template-columns: 1fr;
}

.notes-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas-subtle);
  color: var(--gh-fg);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.notes-panel-actions .notes-btn {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 0.84rem;
}

.notes-btn:hover,
.notes-btn.active {
  border-color: var(--gh-accent);
  background: var(--gh-accent-subtle);
  color: var(--gh-accent);
}

.notes-btn:focus-visible,
.notes-btn.is-program-focus {
  outline: 2px solid var(--gh-accent);
  outline-offset: 2px;
}

.notes-btn.primary {
  border-color: var(--gh-accent);
  background: var(--gh-accent);
  color: #ffffff;
}

.notes-btn.danger {
  color: #cf222e;
}

.notes-btn.ok {
  color: #1a7f37;
}

[data-theme="dark"] .notes-btn.danger {
  color: #ff7b72;
}

[data-theme="dark"] .notes-btn.ok {
  color: #7ee787;
}

.notes-tree-wrap {
  max-height: calc(100dvh - 390px);
  min-height: 300px;
  overflow: auto;
  padding: 8px;
}

.notes-tree,
.tree-node,
.tree-children {
  gap: 0px;
}

.notes-tree {
  display: grid;
}

.tree-node {
  display: grid;
}

.tree-children {
  display: grid;
  margin-left: 10px;
  padding-left: 4px;
  border-left: 1px solid var(--gh-border);
}

.tree-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px;
  align-items: center;
  min-height: 10px;
  padding: 1px 1px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--gh-fg);
  cursor: pointer;
}

.tree-item.is-highlighted .node-title-text {
  color: var(--gh-accent);
  font-weight: 800;
}

.tree-menu-button {
  width: 28px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--gh-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.tree-item:hover .tree-menu-button,
.tree-item:focus-within .tree-menu-button,
.tree-menu-button[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
}

.tree-menu-button:hover {
  border-color: var(--gh-border);
  background: var(--gh-canvas);
  color: var(--gh-accent);
}

.tree-context-menu {
  position: fixed;
  z-index: 200;
  display: grid;
  min-width: 120px;
  padding: 6px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
  box-shadow: var(--gh-shadow);
}

.tree-context-menu button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--gh-fg);
  text-align: center;
  cursor: pointer;
}

.tree-context-menu button:hover {
  background: var(--gh-canvas-subtle);
  color: var(--gh-accent);
}

.tree-item:hover {
  background: var(--gh-canvas-subtle);
}

.tree-item.active {
  border-color: var(--gh-accent);
  background: var(--gh-accent-subtle);
}

.tree-item[data-drop-position="inside"] {
  border-color: var(--gh-accent);
  background: var(--gh-accent-subtle);
}

.tree-item[data-drop-position="before"],
.tree-item[data-drop-position="after"] {
  position: relative;
}

.tree-item[data-drop-position="before"]::before,
.tree-item[data-drop-position="after"]::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--gh-accent);
}

.tree-item[data-drop-position="before"]::before {
  top: -2px;
}

.tree-item[data-drop-position="after"]::after {
  bottom: -2px;
}

.caret {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--gh-muted);
}

.caret:hover {
  background: var(--gh-canvas);
  color: var(--gh-accent);
}

.node-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.9rem;
}

.node-icon {
  color: var(--gh-muted);
  flex: 0 0 auto;
}

.node-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-badge {
  padding: 2px 7px;
  border: 1px solid var(--gh-border);
  border-radius: 999px;
  background: var(--gh-canvas);
  color: var(--gh-muted);
  font-size: 0.72rem;
}

.notes-sidebar-footer {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--gh-border);
  color: var(--gh-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.notes-panel {
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
}

.notes-panel-head {
  position: sticky;
  top: 80px;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  border-top: 0;
  border-bottom: 1px solid var(--gh-border);
  border-radius: 6px 6px 0 0;
  background: var(--gh-canvas-subtle);
}

.notes-panel-head::before {
  content: none;
}

.notes-panel-head.is-stuck::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--gh-border);
  pointer-events: none;
}

.notes-panel-actions,
.notes-meta-row,
.notes-formatbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.notes-document {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.notes-title-input {
  width: 100%;
  min-height: 48px;
  padding: 6px 0;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  background: transparent;
  color: var(--gh-fg);
  font-size: clamp(1.45rem, 2.6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.18;
}

.notes-title-input:disabled {
  color: var(--gh-fg);
}

.notes-meta-row {
  color: var(--gh-muted);
  font-size: 0.84rem;
}

.notes-status.ok {
  color: #1a7f37;
}

.notes-status.warn {
  color: #9a6700;
}

[data-theme="dark"] .notes-status.ok {
  color: #7ee787;
}

[data-theme="dark"] .notes-status.warn {
  color: #d29922;
}

.notes-formatbar {
  position: sticky;
  top: 162px;
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: start;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas-subtle);
  overflow: visible;
  box-shadow: 0 8px 18px rgba(140, 149, 159, 0.16);
}

.notes-formatbar[hidden] {
  display: none;
}

.notes-formatbar.is-html-mode {
  opacity: 0.82;
}

.notes-formatbar.is-html-mode :disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.notes-formatbar.is-html-mode #htmlModeBtn {
  opacity: 1;
}

.notes-divider-panel {
  min-width: 74px;
  width: max-content;
  padding: 4px;
}

.notes-divider-panel.is-floating {
  width: 74px;
  transform: none;
}

.notes-divider-options {
  display: grid;
  gap: 2px;
}

.notes-divider-options .notes-btn {
  justify-content: start;
  min-height: 24px;
  padding: 2px 7px;
  font-size: 0.82rem;
}

.notes-editor hr.is-selected {
  outline: 2px solid var(--gh-accent);
  outline-offset: 4px;
}

.notes-toolbar-group {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 1px;
  width: fit-content;
  max-width: 100%;
  min-width: fit-content;
  padding: 3px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
}

.notes-toolbar-select {
  height: 30px;
  min-width: 64px;
  padding: 0 22px 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  background: transparent;
  color: var(--gh-muted);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.notes-toolbar-select.font {
  min-width: 126px;
}

.notes-toolbar-select.tiny {
  min-width: 54px;
  width: 58px;
}

.notes-font-input {
  width: 168px;
  cursor: text;
  border-color: var(--gh-border);
  background: color-mix(in oklab, var(--gh-canvas), var(--gh-canvas-subtle) 35%);
}

.notes-font-options {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--gh-border);
  border-radius: 8px;
  background: var(--gh-canvas);
  box-shadow: 0 16px 36px rgba(31, 35, 40, 0.18);
}

.notes-font-options[hidden] {
  display: none;
}

.notes-font-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--gh-fg);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.notes-font-option:hover,
.notes-font-option:focus {
  background: var(--gh-canvas-subtle);
  outline: none;
}

.notes-font-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-font-option small {
  flex: 0 0 auto;
  color: var(--gh-muted);
  font-size: 0.72rem;
}

.notes-font-empty {
  padding: 10px 8px;
  color: var(--gh-muted);
  font-size: 0.84rem;
}

.notes-local-font-btn {
  width: 34px;
  min-width: 34px;
  font-weight: 700;
}

.notes-toolbar-select.small {
  border-color: var(--gh-border);
  background: color-mix(in oklab, var(--gh-canvas), var(--gh-canvas-subtle) 35%);
  min-width: 38px;
  width: 42px;
  padding: 0 14px 0 5px;
}

.notes-toolbar-select.quote {
  min-width: 76px;
  width: 86px;
  padding-right: 18px;
}


.notes-color-input {
  width: 22px;
  height: 22px;
  padding: 2px;
  border: 1px solid var(--gh-border);
  border-radius: 5px;
  background: var(--gh-canvas);
  cursor: pointer;
}

.notes-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.notes-color-input::-webkit-color-swatch {
  border: 0;
  border-radius: 3px;
}

.notes-color-input::-moz-color-swatch {
  border: 0;
  border-radius: 3px;
}

.notes-font-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 28px;
  color: var(--gh-muted);
  font-weight: 800;
  line-height: 1;
}

.notes-toolbar-select:hover,
.notes-toolbar-select:focus {
  border-color: var(--gh-border);
  background: var(--gh-canvas);
  color: var(--gh-accent);
}

.notes-icon-btn {
  width: 30px;
  min-width: 30px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--gh-muted);
  font-size: 0.86rem;
  line-height: 1;
}

.notes-icon-btn.wide {
  width: 36px;
  min-width: 36px;
}

.notes-icon-btn.strong {
  font-weight: 800;
}

.notes-icon-btn.italic {
  font-style: italic;
}

.notes-icon-btn.underline {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notes-icon-btn.strike {
  text-decoration: line-through;
}

.notes-toolbar-svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notes-icon-btn:hover,
.notes-icon-btn.active {
  border-color: var(--gh-accent);
  background: var(--gh-accent-subtle);
  color: var(--gh-accent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gh-accent), transparent 78%);
}

.notes-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--gh-muted);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.notes-insert-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
}

.notes-insert-panel.is-floating {
  position: fixed;
  z-index: 180;
  top: 198px;
  left: 50%;
  width: min(760px, calc(100vw - 32px));
  transform: translateX(-50%);
  box-shadow: var(--gh-shadow);
}

.notes-insert-panel.notes-divider-panel.is-floating {
  width: 74px;
  min-width: 74px;
  transform: none;
}

.notes-insert-panel[hidden],
.notes-insert-mode[hidden] {
  display: none;
}

.notes-insert-tabs,
.notes-insert-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.notes-insert-input {
  min-height: 34px;
  min-width: min(360px, 100%);
  flex: 1 1 260px;
  padding: 6px 10px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
  color: var(--gh-fg);
  font: inherit;
}

.notes-insert-input:focus {
  border-color: var(--gh-accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--gh-accent), transparent 78%);
}

.notes-template-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#templatePanel.is-floating {
  max-width: calc(100vw - 24px);
  overflow: auto;
  transform: none;
}

.notes-template-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas-subtle);
  color: var(--gh-fg);
  cursor: pointer;
  text-align: left;
}

.notes-template-card span {
  color: var(--gh-muted);
  font-size: 0.8rem;
}

.notes-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 35, 40, 0.42);
}

.notes-modal[hidden] {
  display: none;
}

.notes-modal-card {
  width: min(860px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--gh-border);
  border-radius: 8px;
  background: var(--gh-canvas);
  color: var(--gh-fg);
  box-shadow: var(--gh-shadow);
}

.notes-modal-head,
.notes-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notes-modal-head {
  margin-bottom: 14px;
}

.notes-modal-head div {
  display: grid;
  gap: 3px;
}

.notes-modal-head span {
  color: var(--gh-muted);
  font-size: 0.86rem;
}

.notes-modal-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.notes-chart-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.notes-chart-settings label,
.notes-chart-check {
  display: grid;
  gap: 5px;
  color: var(--gh-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.notes-chart-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  align-content: center;
  color: var(--gh-fg);
}

.notes-chart-settings input[type="range"] {
  width: 100%;
}

.notes-chart-settings input[type="color"],
.notes-chart-row input[type="color"] {
  width: 42px;
  min-height: 34px;
  padding: 2px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
}

.notes-chart-row-head,
.notes-chart-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(100px, 140px) 56px 42px;
  gap: 8px;
  align-items: center;
}

.notes-chart-row-head {
  margin-bottom: 6px;
  color: var(--gh-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.notes-chart-rows {
  display: grid;
  gap: 8px;
}

.notes-attachment-bar {
  position: sticky;
  top: 80px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas-subtle);
}

.notes-attachment-bar[hidden] {
  display: none;
}

.notes-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notes-attachment {
  padding: 4px 8px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  color: var(--gh-accent);
  background: var(--gh-canvas);
  text-decoration: none;
  font-size: 0.82rem;
}

.notes-view,
.notes-editor,
.notes-empty {
  min-height: 1123px;
  padding: 22px;
  line-height: 1.75;
}

.notes-editor,
.notes-html-editor {
  outline: none;
}

.notes-editor[hidden],
.notes-html-editor[hidden],
.notes-view[hidden],
.notes-empty[hidden] {
  display: none;
}

.notes-html-editor {
  width: 100%;
  min-height: 1123px;
  padding: 18px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
  color: var(--gh-fg);
  font: 0.92rem/1.65 Consolas, "Courier New", monospace;
  resize: vertical;
}

.notes-view h1,
.notes-view h2,
.notes-view h3,
.notes-editor h1,
.notes-editor h2,
.notes-editor h3 {
  margin: 1.15em 0 0.5em;
  color: var(--gh-fg);
  line-height: 1.25;
}

.notes-view h1:first-child,
.notes-view h2:first-child,
.notes-view h3:first-child,
.notes-editor h1:first-child,
.notes-editor h2:first-child,
.notes-editor h3:first-child {
  margin-top: 0;
}

.notes-view p,
.notes-view ul,
.notes-view ol,
.notes-view blockquote,
.notes-view table,
.notes-view pre,
.notes-editor p,
.notes-editor ul,
.notes-editor ol,
.notes-editor blockquote,
.notes-editor table,
.notes-editor pre {
  margin: 0 0 1em;
}

.notes-view a,
.notes-editor a {
  color: var(--gh-accent);
}

.notes-view blockquote,
.notes-editor blockquote {
  display: inline-block;
  margin-left: 0;
  padding: 10px 12px;
  border-left: 4px solid var(--gh-accent);
  border-radius: 6px;
  background: var(--gh-accent-subtle);
  color: var(--gh-muted);
}

.notes-view blockquote.note-quote-default,
.notes-editor blockquote.note-quote-default,
.notes-view blockquote[data-quote-style="default"],
.notes-editor blockquote[data-quote-style="default"] {
  display: inline-block;
  border-left-color: var(--gh-accent);
  background: var(--gh-accent-subtle);
  color: var(--gh-muted);
}

.notes-view blockquote.note-quote-emphasis,
.notes-editor blockquote.note-quote-emphasis,
.notes-view blockquote[data-quote-style="emphasis"],
.notes-editor blockquote[data-quote-style="emphasis"] {
  display: inline-block;
  border-left-color: #8250df;
  background: rgba(130, 80, 223, 0.1);
  color: var(--gh-fg);
  font-weight: 600;
}

.notes-view blockquote.note-quote-info,
.notes-editor blockquote.note-quote-info,
.notes-view blockquote[data-quote-style="info"],
.notes-editor blockquote[data-quote-style="info"] {
  display: inline-block;
  border-left-color: #0969da;
  background: rgba(9, 105, 218, 0.09);
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-warning,
.notes-editor blockquote.note-quote-warning,
.notes-view blockquote[data-quote-style="warning"],
.notes-editor blockquote[data-quote-style="warning"] {
  display: inline-block;
  border-left-color: #bf8700;
  background: rgba(191, 135, 0, 0.12);
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-success,
.notes-editor blockquote.note-quote-success,
.notes-view blockquote[data-quote-style="success"],
.notes-editor blockquote[data-quote-style="success"] {
  display: inline-block;
  border-left-color: #1a7f37;
  background: rgba(26, 127, 55, 0.1);
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-question,
.notes-editor blockquote.note-quote-question,
.notes-view blockquote[data-quote-style="question"],
.notes-editor blockquote[data-quote-style="question"] {
  display: inline-block;
  border-left-color: #d1242f;
  background: rgba(209, 36, 47, 0.09);
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-minimal,
.notes-editor blockquote.note-quote-minimal,
.notes-view blockquote[data-quote-style="minimal"],
.notes-editor blockquote[data-quote-style="minimal"] {
  display: inline-block;
  padding: 6px 0 6px 14px;
  border-left-color: var(--gh-border);
  border-radius: 0;
  background: transparent;
  color: var(--gh-muted);
}

.notes-view blockquote.note-quote-minimal-gray,
.notes-editor blockquote.note-quote-minimal-gray,
.notes-view blockquote[data-quote-style="minimal-gray"],
.notes-editor blockquote[data-quote-style="minimal-gray"] {
  display: inline-block;
  padding: 6px 0 6px 14px;
  border-left-color: var(--gh-border);
  border-radius: 0;
  background: transparent;
  color: var(--gh-muted);
}

.notes-view blockquote.note-quote-minimal-red,
.notes-editor blockquote.note-quote-minimal-red,
.notes-view blockquote[data-quote-style="minimal-red"],
.notes-editor blockquote[data-quote-style="minimal-red"] {
  display: inline-block;
  padding: 6px 0 6px 14px;
  border-left-color: #d1242f;
  border-radius: 0;
  background: transparent;
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-minimal-orange,
.notes-editor blockquote.note-quote-minimal-orange,
.notes-view blockquote[data-quote-style="minimal-orange"],
.notes-editor blockquote[data-quote-style="minimal-orange"] {
  display: inline-block;
  padding: 6px 0 6px 14px;
  border-left-color: #bf8700;
  border-radius: 0;
  background: transparent;
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-minimal-yellow,
.notes-editor blockquote.note-quote-minimal-yellow,
.notes-view blockquote[data-quote-style="minimal-yellow"],
.notes-editor blockquote[data-quote-style="minimal-yellow"] {
  display: inline-block;
  padding: 6px 0 6px 14px;
  border-left-color: #9a6700;
  border-radius: 0;
  background: transparent;
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-minimal-green,
.notes-editor blockquote.note-quote-minimal-green,
.notes-view blockquote[data-quote-style="minimal-green"],
.notes-editor blockquote[data-quote-style="minimal-green"] {
  display: inline-block;
  padding: 6px 0 6px 14px;
  border-left-color: #1a7f37;
  border-radius: 0;
  background: transparent;
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-minimal-blue,
.notes-editor blockquote.note-quote-minimal-blue,
.notes-view blockquote[data-quote-style="minimal-blue"],
.notes-editor blockquote[data-quote-style="minimal-blue"] {
  display: inline-block;
  padding: 6px 0 6px 14px;
  border-left-color: #0969da;
  border-radius: 0;
  background: transparent;
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-minimal-purple,
.notes-editor blockquote.note-quote-minimal-purple,
.notes-view blockquote[data-quote-style="minimal-purple"],
.notes-editor blockquote[data-quote-style="minimal-purple"] {
  display: inline-block;
  padding: 6px 0 6px 14px;
  border-left-color: #8250df;
  border-radius: 0;
  background: transparent;
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-minimal-pink,
.notes-editor blockquote.note-quote-minimal-pink,
.notes-view blockquote[data-quote-style="minimal-pink"],
.notes-editor blockquote[data-quote-style="minimal-pink"] {
  display: inline-block;
  padding: 6px 0 6px 14px;
  border-left-color: #d61a7f;
  border-radius: 0;
  background: transparent;
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-bubble,
.notes-editor blockquote.note-quote-bubble,
.notes-view blockquote[data-quote-style="bubble"],
.notes-editor blockquote[data-quote-style="bubble"] {
  display: inline-block;
  padding: 12px 16px;
  background: var(--gh-canvas-inset);
  border: 2px solid var(--gh-accent);
  border-radius: 18px;
  position: relative;
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-bubble::after,
.notes-editor blockquote.note-quote-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--gh-accent);
}

.notes-view blockquote.note-quote-postit,
.notes-editor blockquote.note-quote-postit,
.notes-view blockquote[data-quote-style="postit"],
.notes-editor blockquote[data-quote-style="postit"] {
  display: inline-block;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  color: #92400e;
  position: relative;
}

.notes-view blockquote.note-quote-postit::before,
.notes-editor blockquote.note-quote-postit::before {
  content: '';
  position: absolute;
  top: -2px;
  right: 20px;
  width: 20px;
  height: 20px;
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.notes-view blockquote.note-quote-corner-frame,
.notes-editor blockquote.note-quote-corner-frame,
.notes-view blockquote[data-quote-style="corner-frame"],
.notes-editor blockquote[data-quote-style="corner-frame"] {
  display: inline-block;
  padding: 16px 20px;
  background: var(--gh-canvas-inset);
  border: 2px solid var(--gh-border);
  border-radius: 0;
  position: relative;
  color: var(--gh-fg);
}

.notes-view blockquote.note-quote-corner-frame::before,
.notes-editor blockquote.note-quote-corner-frame::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 20px;
  height: 20px;
  border-top: 4px solid var(--gh-accent);
  border-left: 4px solid var(--gh-accent);
}

.notes-view blockquote.note-quote-corner-frame::after,
.notes-editor blockquote.note-quote-corner-frame::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-bottom: 4px solid var(--gh-accent);
  border-right: 4px solid var(--gh-accent);
}

.notes-view code,
.notes-editor code {
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--gh-canvas-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.notes-view pre,
.notes-editor pre {
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas-subtle);
}

.code-keyword {
  color: #cf222e;
  font-weight: 700;
}

.code-function {
  color: #8250df;
}

.notes-view table,
.notes-editor table {
  width: 100%;
  border-collapse: collapse;
}

.notes-editor table.is-selected {
  outline: 2px solid var(--gh-accent);
  outline-offset: 3px;
}

.notes-table-resize-overlay {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
}

.notes-table-resize-handle {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: col-resize;
  pointer-events: auto;
  transform: translateX(-50%);
}

.notes-table-resize-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 2px;
  border-radius: 2px;
  background: color-mix(in oklab, var(--gh-accent), transparent 28%);
  opacity: 0.7;
}

.notes-table-resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 26px;
  border: 1px solid var(--gh-accent);
  border-radius: 6px;
  background: var(--gh-canvas);
  box-shadow: 0 2px 8px rgba(31, 35, 40, 0.16);
  transform: translate(-50%, -50%);
  opacity: 0;
}

.notes-table-resize-handle:hover::before,
.notes-table-resize-handle:focus-visible::before,
.notes-table-resizing .notes-table-resize-handle::before {
  opacity: 1;
}

.notes-table-resize-handle:hover::after,
.notes-table-resize-handle:focus-visible::after,
.notes-table-resizing .notes-table-resize-handle::after {
  opacity: 1;
}

.notes-table-resize-handle.is-table::before {
  width: 3px;
}

.notes-table-resizing,
.notes-table-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.notes-view img,
.notes-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.note-resizable {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  height: auto !important;
  min-width: 80px;
  line-height: 0;
  resize: horizontal;
  overflow: hidden;
  vertical-align: middle;
}

.note-resizable img,
.note-resizable video {
  display: block;
  width: 100%;
  height: auto !important;
  max-width: 100%;
  border-radius: 6px;
}

.notes-editor video {
  resize: horizontal;
  overflow: hidden;
  display: inline-block;
  min-width: 80px;
  height: auto;
}

.note-video-resizable {
  width: min(520px, 100%);
}

.note-video-figure {
  display: block;
  width: min(560px, 100%);
  max-width: 100%;
  margin: 8px 0 1em;
  resize: horizontal;
  overflow: hidden;
  align-items: center;
}

.note-video-figure iframe,
.note-video-figure video {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 6px;
  background: #000;
}

.note-video-figure figcaption {
  margin-top: 6px;
  color: var(--gh-muted);
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.note-video-figure[data-align="center"] {
  margin-left: auto;
  margin-right: auto;
}

.note-video-figure[data-align="right"] {
  margin-left: auto;
  margin-right: 0;
}

.note-video,
.notes-view video,
.notes-editor video {
  max-width: 100%;
  border-radius: 6px;
}

.note-link-preview {
  display: grid;
  gap: 6px;
  margin: 8px 0 1em;
  padding: 10px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas-subtle);
}

.note-link-preview span,
.note-link-preview figcaption {
  color: var(--gh-muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.note-link-preview iframe {
  width: 100%;
  min-height: 280px;
  border: 0;
  border-radius: 6px;
  background: var(--gh-canvas);
}

.note-dropcap::first-letter {
  float: left;
  margin: 0 8px 0 0;
  font-size: 3em;
  line-height: 0.9;
  font-weight: 700;
}

.note-chart {
  display: grid;
  gap: 10px;
  width: min(520px, 100%);
  box-sizing: border-box;
  margin: 0 0 1em;
  padding: 14px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
  box-shadow: 0 8px 18px rgba(31, 35, 40, 0.06);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.note-chart.is-selected {
  outline: 2px solid var(--gh-accent);
  outline-offset: 2px;
}

.note-chart figcaption {
  color: var(--gh-fg);
  font-weight: 700;
  text-align: center;
}

.note-chart::selection,
.note-chart *::selection {
  background: transparent;
}

.note-chart > * {
  pointer-events: none;
}

.note-chart-help {
  display: block;
  padding-top: 8px;
  border-top: 1px solid var(--gh-border);
  color: var(--gh-muted);
  font-size: 0.72rem;
  text-align: right;
}

.note-chart-body {
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas-subtle);
  height: 180px;
  min-height: 180px;
  overflow: hidden;
}

.note-chart-bars {
  inline-size: 100%;
  min-width: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: end;
  justify-content: stretch;
  gap: 10px;
  padding: 16px 12px 30px;
}

.note-chart-svg {
  display: grid;
  padding: 16px;
}

.note-chart-svg svg {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
}

.note-chart-svg text {
  font-size: 11px;
  dominant-baseline: middle;
}

.note-chart-label,
.note-chart-line text {
  fill: var(--gh-muted);
}

.note-chart-value,
.note-chart-percent {
  font-weight: 700;
}

.note-chart-bar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  justify-self: center;
  width: min(var(--bar-size, 30px), 100%);
  max-width: 72px;
  height: var(--bar-height, 20%);
  min-height: 18px;
  background: var(--chart-color, var(--gh-accent));
  border-radius: 6px 6px 0 0;
  color: #fff;
}

.note-chart-bar span,
.note-chart-hbar b {
  padding-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}

.note-chart-bar em,
.note-chart-hbar em {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.note-chart-bar small {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  max-width: 100%;
  transform: translateX(-50%);
  overflow: hidden;
  color: var(--gh-muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-chart.note-chart-bar {
  display: grid;
  align-items: initial;
  justify-content: initial;
  gap: 10px;
  width: min(520px, 100%);
  max-width: 100%;
  height: auto;
  min-height: 0;
  margin: 0 0 1em;
  padding: 14px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: var(--gh-canvas);
  color: var(--gh-fg);
}

.note-chart-hbars {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.note-chart-vbars,
.note-chart-line {
  gap: 0;
}

.note-chart-hbar {
  display: grid;
  grid-template-columns: minmax(64px, 110px) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.note-chart-hbar small {
  overflow: hidden;
  color: var(--gh-muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-chart-hbar span {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: var(--bar-width, 10%);
  min-width: 24px;
  height: var(--bar-size, 30px);
  padding-left: 8px;
  border-radius: 0 6px 6px 0;
  background: var(--chart-color, var(--gh-accent));
  color: #fff;
}

.note-chart-line svg {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.note-chart-line text {
  fill: var(--gh-muted);
  font-size: 11px;
}

.note-chart-axis {
  stroke: var(--gh-border);
  stroke-width: 1;
}

.note-chart-radial-wrap {
  display: grid;
  grid-template-columns: minmax(130px, 150px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.note-chart-radial {
  position: relative;
  width: min(150px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--gh-border);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.note-chart-radial.is-doughnut::after {
  content: "";
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background: var(--gh-canvas-subtle);
}

.note-chart-radial.is-doughnut span {
  position: absolute;
  inset: 26%;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--gh-fg);
  font-weight: 700;
}

.note-chart-polar {
  position: relative;
  width: min(150px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--gh-border);
  border-radius: 50%;
  background: radial-gradient(circle, transparent 0 28%, color-mix(in oklab, var(--gh-border), transparent 60%) 29% 30%, transparent 31% 58%, color-mix(in oklab, var(--gh-border), transparent 60%) 59% 60%, transparent 61%);
}

.note-chart-polar span {
  position: absolute;
  inset: calc((100% - var(--polar-size)) / 2);
  border-radius: 50%;
  background: color-mix(in oklab, var(--chart-color), transparent 32%);
  border: 2px solid var(--chart-color);
  transform: rotate(calc(360deg / var(--polar-count, 1) * var(--i, 0)));
}

.note-chart-polar span:nth-child(1) { --i: 0; }
.note-chart-polar span:nth-child(2) { --i: 1; }
.note-chart-polar span:nth-child(3) { --i: 2; }
.note-chart-polar span:nth-child(4) { --i: 3; }
.note-chart-polar span:nth-child(5) { --i: 4; }
.note-chart-polar span:nth-child(6) { --i: 5; }
.note-chart-polar span:nth-child(7) { --i: 6; }
.note-chart-polar span:nth-child(8) { --i: 7; }

.note-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.note-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--gh-muted);
  font-size: 0.8rem;
}

.note-chart-legend i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
}

.notes-view th,
.notes-view td,
.notes-editor th,
.notes-editor td {
  border: 1px solid var(--gh-border);
  padding: 8px 10px;
  text-align: left;
}

.notes-view .calculator-notes-report {
  display: grid;
  gap: 14px;
  max-width: 880px;
}

.notes-view .calculator-notes-report h2 {
  margin: 18px 0 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gh-border);
  color: var(--gh-fg);
  font-size: 1.2rem;
}

.notes-view .calculator-notes-report table,
.notes-editor .calculator-notes-report table {
  margin: 0;
  width: 100%;
  table-layout: fixed;
}

.notes-view .calculator-notes-report table.calculator-notes-equal-table,
.notes-editor .calculator-notes-report table.calculator-notes-equal-table {
  table-layout: fixed;
}

.notes-view .calculator-notes-report table.calculator-notes-equal-table th,
.notes-view .calculator-notes-report table.calculator-notes-equal-table td,
.notes-editor .calculator-notes-report table.calculator-notes-equal-table th,
.notes-editor .calculator-notes-report table.calculator-notes-equal-table td {
  width: auto;
  word-break: break-word;
}

.notes-view .calculator-notes-report th,
.notes-view .calculator-notes-report td,
.notes-editor .calculator-notes-report th,
.notes-editor .calculator-notes-report td {
  word-break: break-word;
}

.notes-view .calculator-notes-report th {
  background: var(--gh-canvas-subtle);
  color: var(--gh-fg);
}

.notes-view .calculator-notes-report td {
  color: var(--gh-fg);
}

.notes-view .calculator-notes-report ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--gh-muted);
}

.notes-view .calculator-notes-fold-details,
.notes-editor .calculator-notes-fold-details {
  margin: 10px 0 18px;
  border: 1px solid var(--gh-border);
  border-radius: 8px;
  background: var(--gh-canvas);
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
}

.notes-view .calculator-notes-fold-details summary,
.notes-editor .calculator-notes-fold-details summary {
  cursor: pointer;
  padding: 12px 14px;
  background: var(--gh-canvas-subtle);
  color: var(--gh-fg);
  font-weight: 700;
  list-style: none;
}

.notes-view .calculator-notes-fold-details summary::-webkit-details-marker,
.notes-editor .calculator-notes-fold-details summary::-webkit-details-marker {
  display: none;
}

.notes-view .calculator-notes-fold-details summary::after,
.notes-editor .calculator-notes-fold-details summary::after {
  content: '+';
  float: right;
  color: var(--gh-accent);
  font-weight: 900;
}

.notes-view .calculator-notes-fold-details[open] summary::after,
.notes-editor .calculator-notes-fold-details[open] summary::after {
  content: '-';
}

.notes-view .calculator-notes-fold-details .calculator-table-wrap,
.notes-editor .calculator-notes-fold-details .calculator-table-wrap {
  padding: 0 12px 12px;
  overflow-x: auto;
}

.notes-view .calculator-notes-share-bars,
.notes-editor .calculator-notes-share-bars {
  display: grid;
  gap: 10px;
  margin: 8px 0 18px;
  min-width: 0;
}

.notes-view .calculator-notes-share-bar,
.notes-editor .calculator-notes-share-bar {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.notes-view .calculator-notes-share-bar .calculator-share-bar-head,
.notes-editor .calculator-notes-share-bar .calculator-share-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--gh-fg);
  font-size: 0.92rem;
  line-height: 1.45;
}

.notes-view .calculator-notes-share-bar .calculator-share-bar-head span,
.notes-editor .calculator-notes-share-bar .calculator-share-bar-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notes-view .calculator-notes-share-bar .calculator-share-bar-head strong,
.notes-editor .calculator-notes-share-bar .calculator-share-bar-head strong {
  flex: 0 0 auto;
  color: var(--gh-accent);
  font-size: 0.9rem;
}

.notes-view .calculator-notes-share-bar .calculator-share-track,
.notes-editor .calculator-notes-share-bar .calculator-share-track {
  position: relative;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--gh-border);
  border-radius: 999px;
  background: var(--gh-canvas-subtle);
}

.notes-view .calculator-notes-share-bar .calculator-share-fill,
.notes-editor .calculator-notes-share-bar .calculator-share-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--gh-accent);
}

.notes-view .calculator-notes-charts,
.notes-editor .calculator-notes-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 12px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.notes-view .calculator-notes-chart,
.notes-editor .calculator-notes-chart {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  margin: 0;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  padding: 10px;
  background: var(--gh-canvas-subtle);
  break-inside: avoid;
  page-break-inside: avoid;
}

.notes-view .calculator-notes-charts.travel-notes-chart-grid,
.notes-editor .calculator-notes-charts.travel-notes-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notes-view .calculator-notes-charts.travel-notes-chart-grid .travel-notes-share-chart,
.notes-editor .calculator-notes-charts.travel-notes-chart-grid .travel-notes-share-chart {
  grid-column: 1 / -1;
}

.notes-view .calculator-notes-chart img,
.notes-editor .calculator-notes-chart img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: #fff;
}

.notes-view .calculator-notes-chart svg,
.notes-editor .calculator-notes-chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
}

.notes-view .calculator-notes-map,
.notes-editor .calculator-notes-map {
  grid-template-rows: auto auto;
}

.notes-view .calculator-notes-map-frame,
.notes-editor .calculator-notes-map-frame {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background: #eef6ff;
}

.notes-view .calculator-notes-map-frame iframe,
.notes-editor .calculator-notes-map-frame iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.notes-view .calculator-notes-map-frame svg,
.notes-editor .calculator-notes-map-frame svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  pointer-events: none;
}

.notes-view .calculator-notes-map-frame svg .route-line,
.notes-editor .calculator-notes-map-frame svg .route-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 5;
  stroke-linecap: round;
}

.notes-view .calculator-notes-map-frame svg circle,
.notes-editor .calculator-notes-map-frame svg circle {
  stroke: #fff;
  stroke-width: 0.8;
}

.notes-view .calculator-notes-map-frame svg .dep,
.notes-editor .calculator-notes-map-frame svg .dep {
  fill: #2563eb;
}

.notes-view .calculator-notes-map-frame svg .arr,
.notes-editor .calculator-notes-map-frame svg .arr {
  fill: #16a34a;
}

.notes-view .calculator-notes-tile-map .map-bg,
.notes-editor .calculator-notes-tile-map .map-bg {
  fill: #eef6ff;
}

.notes-view .calculator-notes-tile-map .map-tiles image,
.notes-editor .calculator-notes-tile-map .map-tiles image {
  image-rendering: auto;
}

.notes-view .calculator-notes-tile-map .route-label,
.notes-editor .calculator-notes-tile-map .route-label {
  fill: #0f172a;
  font-size: 18px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-linejoin: round;
  stroke-width: 4;
}

.notes-view .calculator-notes-chart figcaption,
.notes-editor .calculator-notes-chart figcaption {
  margin-top: 8px;
  color: var(--gh-muted);
  font-size: 0.9rem;
  text-align: center;
}

.notes-view .calculator-notes-charts.rental-notes-chart-grid,
.notes-editor .calculator-notes-charts.rental-notes-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notes-view .calculator-notes-chart .rental-notes-bar-chart,
.notes-editor .calculator-notes-chart .rental-notes-bar-chart {
  align-content: center;
  align-self: stretch;
  width: 100%;
  margin: 0;
}

.notes-view .calculator-notes-chart .calculator-chart-legend,
.notes-editor .calculator-notes-chart .calculator-chart-legend {
  max-width: 100%;
  min-width: 0;
}

.notes-view .calculator-notes-chart .calculator-chart-legend .item,
.notes-editor .calculator-notes-chart .calculator-chart-legend .item {
  max-width: 100%;
  min-width: 0;
}

.notes-view .calculator-notes-chart .calculator-chart-legend .name,
.notes-editor .calculator-notes-chart .calculator-chart-legend .name {
  min-width: 0;
  max-width: min(220px, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-view .calculator-notes-meta {
  margin: 0;
  color: var(--gh-muted);
  font-size: 0.9rem;
}

.notes-view .calculator-notes-intro {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--gh-muted);
  line-height: 1.65;
}

.notes-view .calculator-notes-intro p {
  margin: 0;
}

.notes-view .calculator-notes-summary {
  margin: 0;
  border-left: 3px solid var(--gh-accent);
  padding: 10px 12px;
  background: var(--gh-accent-subtle);
  color: var(--gh-fg);
}

.notes-empty {
  color: var(--gh-muted);
}

.notes-empty strong {
  color: var(--gh-fg);
}

.notes-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 980px) {
  .notes-shell {
    grid-template-columns: 1fr;
  }

  .notes-sidebar {
    position: static;
  }

  .notes-tree-wrap {
    max-height: 360px;
  }
}

@media (max-width: 720px) {
  .notes-main {
    width: min(100% - 20px, 1280px);
    margin-top: 16px;
  }

  .notes-panel-head {
    top: 58px;
    display: grid;
  }

  .notes-formatbar {
    top: 174px;
  }

  .notes-toolbar-group {
    flex-wrap: wrap;
    min-width: 0;
  }

  .notes-view,
  .notes-editor,
  .notes-empty {
    min-height: 1123px;
    padding: 16px;
  }

  .notes-view .calculator-notes-charts,
  .notes-editor .calculator-notes-charts {
    grid-template-columns: 1fr;
  }

  .notes-template-list {
    grid-template-columns: 1fr;
  }

  .notes-chart-settings,
  .notes-chart-row-head,
  .notes-chart-row {
    grid-template-columns: 1fr;
  }

  .notes-chart-row-head,
  #repo-notesBtn {
    display: none;
  }

  .note-chart-radial-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

@media print {
  .github-topbar,
  .repo-hero,
  .notes-sidebar,
  .notes-panel-head,
  .notes-formatbar,
  .notes-insert-panel,
  .notes-modal,
  .notes-attachment-bar,
  .footer {
    display: none !important;
  }

  .notes-main,
  .notes-shell,
  .notes-panel {
    width: 100%;
    margin: 0;
    display: block;
    border: 0;
  }

  .notes-view {
    min-height: auto;
    border: 0;
    padding: 0;
  }

  .notes-view .calculator-notes-report {
    display: block;
    max-width: none;
  }

  .notes-view .calculator-notes-report h2 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .notes-view .calculator-notes-report table,
  .notes-view .calculator-notes-summary,
  .notes-view .calculator-notes-charts,
  .notes-view .calculator-notes-chart {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .notes-view .calculator-notes-charts {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  }

  .notes-view .calculator-notes-chart img {
    max-height: 230px;
  }
}


.calculator-page {
  display: grid;
  gap: 14px;
  width: min(1280px, calc(100% - 32px));
  margin: 16px auto 0;
}

.calculator-cover,
.calculator-panel,
.calculator-guide-section,
.calculator-related-section {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.calculator-panel,
.calculator-guide-section,
.calculator-related-section,
.calculator-page [id] {
  scroll-margin-top: 96px;
}

.calculator-kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calculator-actions,
.calculator-chip-row,
.calculator-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.calculator-result .calculator-button-row {
  gap: 10px;
  align-items: stretch;
  margin-top: 4px;
}

.calculator-actions {
  margin-top: 16px;
}

.calculator-button,
.calculator-ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.calculator-button {
  border: 1px solid #909693;
  background: #5c6268;
  color: #fff;
}

.calculator-button:hover {
  border-color: #6e7781;
  background: #6e7781;
  color: #fff;
}

html[data-theme="dark"] .calculator-button {
  border-color: #8b949e;
  background: #30363d;
  color: #f0f6fc;
}

html[data-theme="dark"] .calculator-button:hover {
  border-color: #c9d1d9;
  background: #484f58;
  color: #ffffff;
}

.calculator-ghost-button {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink-strong);
}

#resetBtn {
  border-color: #8c959f;
  background: #f6f8fa;
  color: #57606a;
}

#resetBtn:hover {
  border-color: #6e7781;
  background: #eef1f4;
  color: #24292f;
}

[data-theme="dark"] #resetBtn {
  border-color: #6e7681;
  background: #161b22;
  color: #c9d1d9;
}

[data-theme="dark"] #resetBtn:hover {
  border-color: #8b949e;
  background: #21262d;
  color: #f0f6fc;
}

.calculator-ghost-button:hover {
  border-color: var(--brand);
}

.calculator-notes-link {
  gap: 8px;
  border-color: color-mix(in oklab, var(--brand), var(--line) 45%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--brand), #fff 92%), color-mix(in oklab, var(--brand), #fff 86%));
  color: var(--brand);
  box-shadow: inset 0 -1px 0 color-mix(in oklab, var(--brand), transparent 78%);
}

.calculator-notes-link span {
  border-radius: 999px;
  padding: 2px 6px;
  background: color-mix(in oklab, var(--brand), transparent 86%);
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.calculator-notes-link strong {
  font-weight: 800;
}

.calculator-notes-link:hover,
.calculator-notes-link:focus-visible {
  background: color-mix(in oklab, var(--brand), transparent 84%);
  color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand), transparent 86%);
}

.calculator-chip-row {
  margin-top: 16px;
}

.calculator-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel-soft);
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.calculator-cover {
  overflow: hidden;
  background: var(--panel-soft);
}

.calculator-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.calculator-cover figcaption {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.calculator-grid:has(.calculator-aside) {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.calculator-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.calculator-aside {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-self: start;
}

.calculator-panel,
.calculator-guide-section,
.calculator-related-section,
.calculator-aside-section {
  padding: 16px;
}

.calculator-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.calculator-panel h2,
.calculator-guide-section h2,
.calculator-related-section h2,
.calculator-aside-section h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.calculator-panel p,
.calculator-guide-section p,
.calculator-related-section p,
.calculator-aside-section p {
  color: var(--ink-soft);
  line-height: 1.68;
}

.calculator-aside-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.calculator-aside-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calculator-aside-list a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink-strong);
  text-decoration: none;
  background: var(--panel-soft);
  line-height: 1.35;
}

.calculator-aside-list a:hover {
  border-color: var(--brand);
}


.post-page {
  width: min(1440px, calc(100% - 32px));
}

.post-page .calculator-grid:has(.calculator-aside) {
  grid-template-columns: minmax(0, 5fr) minmax(300px, 2fr);
}

body:has(.post-page) .repo-title {
  margin-left: 4px;
}

.post-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: -4px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.post-article-cover {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0 0 24px;
}

.post-article-cover img {
  width: min(100%, 720px);
  height: auto;
  border-radius: 8px;
  background: var(--panel-soft);
}

.post-article-cover figcaption {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

.post-article-body {
  max-width: 920px;
  margin-inline: auto;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.75;
}

.post-article-body h1,
.post-article-body h2,
.post-article-body h3 {
  margin: 28px 0 12px;
  color: var(--ink-strong);
  line-height: 1.3;
}

.post-article-body h1 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.post-article-body p {
  margin: 0 0 16px;
}

.post-article-body ul,
.post-article-body ol {
  margin: 0 0 18px;
  padding-left: 1.4rem;
}

.post-article-body li + li {
  margin-top: 6px;
}

.post-article-body li::marker {
  color: var(--brand);
}

.post-article-body strong {
  color: var(--ink-strong);
}

.post-article-body a {
  color: var(--brand);
  overflow-wrap: anywhere;
}

.post-article-body hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.post-article-body img {
  max-width: 100%;
  height: auto;
}

.post-article-body blockquote {
  margin: 18px 0;
  border-left: 4px solid var(--brand);
  padding: 12px 16px;
  background: var(--panel-soft);
  color: var(--ink-soft);
}

.post-article-body blockquote p:last-child {
  margin-bottom: 0;
}

.post-article-body pre {
  max-width: 100%;
  margin: 18px 0;
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  background: #0d1117;
  color: #e6edf3;
  tab-size: 2;
  white-space: pre-line;
}

.post-article-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.post-article-body pre code {
  white-space: inherit;
}

.post-article-body table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
}

.post-article-body th,
.post-article-body td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--ink-soft);
  text-align: left;
  vertical-align: top;
}

.post-article-body th {
  background: var(--panel-soft);
  color: var(--ink-strong);
}

.post-article-body details {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.post-article-body summary {
  cursor: pointer;
  padding: 12px;
  color: var(--ink-strong);
  font-weight: 700;
}

.post-article-body .article-cover {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 20px auto 24px;
}

.post-article-body .article-cover img {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-article-body .article-cover figcaption {
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-align: center;
}

.post-article-body .person-card {
  max-width: 620px;
  margin: 32px auto;
  padding: 24px 20px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.post-article-body .person-card .article-cover {
  margin-top: 0;
}

.post-article-body .person-card h3 {
  margin: 16px 0 10px;
}

.post-article-body .person-card p {
  margin: 0;
  text-align: left;
}

@media (max-width: 640px) {
  .post-article-body .person-card {
    padding: 18px 14px 16px;
    margin: 24px auto;
  }
}

.post-author-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.post-author-card img {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 999px;
  object-fit: cover;
  background: var(--panel-soft);
}

.post-author-card p {
  margin: 3px 0 0;
}

@media (max-width: 640px) {
  .post-page {
    width: min(100% - 20px, 1440px);
  }
}

.calculator-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.calculator-settings-subhead {
  margin: 18px 28px 8px;
  padding-left: 12px;
  border-left: 3px solid color-mix(in srgb, var(--brand) 55%, var(--line));
  color: var(--ink-strong);
}

.calculator-input-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}

.calculator-input-card.subtle {
  background: color-mix(in srgb, var(--panel-soft) 72%, var(--panel) 28%);
}

.calculator-tab-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}

.calculator-tab-panel[hidden] {
  display: none !important;
}

.calculator-mode-inputs {
  display: flex;
  gap: 12px;
  grid-column: 1 / -1;
}

.calculator-mode-inputs > .calculator-input-card {
  flex: 1;
  min-width: 0;
}
.calculator-input-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.calculator-input-card-head h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1rem;
  line-height: 1.35;
}

.calculator-input-card-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.calculator-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.calculator-input-with-unit {
  position: relative;
  min-width: 0;
}

.calculator-input-with-unit input {
  padding-right: 78px;
}

.calculator-input-with-unit input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.calculator-input-with-unit input[type="number"]::-webkit-outer-spin-button,
.calculator-input-with-unit input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.calculator-unit-badge {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  max-width: 64px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.calculator-method-select {
  min-height: 48px;
  font-weight: 750;
}

.calculator-helper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calculator-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.calculator-mode-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.calculator-mode-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.calculator-mode-tab:not(:last-child) {
  border-right: 1px solid var(--border);
}

.calculator-mode-tab:hover {
  background: var(--brand-soft);
  color: var(--ink-strong);
}

.calculator-mode-tab.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.calculator-mode-tab:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.calculator-field.full {
  grid-column: 1 / -1;
}

.calculator-error.full {
  grid-column: 1 / -1;
}

.calculator-field.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.calculator-action-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
  width: min(100%, 344px);
  max-width: 100%;
  margin-left: auto;
}

.calculator-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.calculator-action-buttons .calculator-button,
.calculator-action-buttons .calculator-ghost-button {
  width: 100%;
}

.calculator-field label {
  color: var(--ink-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.calculator-field input,
.calculator-field select,
.calculator-field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--panel-strong);
  color: var(--ink-strong);
  outline: none;
}

.calculator-field textarea {
  min-height: 96px;
  resize: vertical;
}

.calculator-field input:focus,
.calculator-field select:focus,
.calculator-field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand), transparent 84%);
}

.calculator-field input[aria-invalid="true"],
.calculator-field select[aria-invalid="true"],
.calculator-field textarea[aria-invalid="true"] {
  border-color: #cf222e;
}

.calculator-field.calculator-disabled-field label {
  color: var(--ink-soft);
}

.calculator-field.calculator-disabled-field input,
.calculator-field.calculator-disabled-field select,
.calculator-field.calculator-disabled-field textarea,
.calculator-field input:disabled,
.calculator-field select:disabled,
.calculator-field textarea:disabled {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--ink-soft) 22%, var(--line) 78%);
  background: color-mix(in srgb, var(--ink-soft) 5%, var(--panel) 95%);
  color: var(--ink-soft);
  cursor: not-allowed;
  opacity: 0.72;
}

.calculator-error {
  margin: 0;
  color: #cf222e;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.calculator-error[hidden],
.calculator-result[hidden] {
  display: none !important;
}

.calculator-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.calculator-helper-note {
  margin: -2px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: right;
}

.calculator-result {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 14px;
  background: var(--panel-soft);
}

.calculator-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.calculator-result-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.calculator-result-card span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.calculator-result-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink-strong);
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.calculator-result-highlight-grid {
  gap: 12px;
}

.calculator-result-highlight-card {
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line) 82%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, transparent), transparent 54%),
    var(--panel);
}

.calculator-result-highlight-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
  opacity: 0.75;
}

.calculator-result-highlight-card span {
  color: var(--ink-soft);
  font-size: 0.76rem;
  letter-spacing: 0;
}

.calculator-result-highlight-card strong {
  margin-top: 8px;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.calculator-table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calculator-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--panel);
}

.calculator-table.scenario-compare-table {
  table-layout: fixed;
}

.calculator-table th,
.calculator-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.calculator-table thead th {
  background: var(--panel-soft);
  color: var(--ink-strong);
  font-size: 0.84rem;
}

.calculator-formula-box {
  display: grid;
  gap: 10px;
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 16px 0 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, var(--brand) 4%);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.calculator-formula-row {
  display: grid;
  gap: 8px;
  align-items: stretch;
  box-sizing: border-box;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, var(--brand) 2%), var(--panel));
}

.calculator-formula-row span,
.calculator-formula-row strong {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.calculator-formula-row code,
.calculator-formula-row strong + span {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line) 86%);
  background: color-mix(in srgb, var(--panel-strong) 88%, var(--brand) 12%);
  color: var(--ink-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.calculator-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.calculator-chart-card,
.calculator-insight-box,
.calculator-recent-list > *,
.calculator-share-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.calculator-chart-card figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: end;
  gap: 8px;
  height: 100%;
  margin: 0;
}

.calculator-chart-card canvas {
  width: 100%;
  max-width: 360px;
  min-width: 0;
  min-height: 220px;
}

.calculator-chart-card #barChart,
.calculator-chart-card #stageChart {
  height: clamp(300px, 32vw, 340px) !important;
  align-self: end;
}

.calculator-chart-card.calculator-chart-card-wide {
  grid-column: 1 / -1;
}

.calculator-chart-card.calculator-chart-card-wide canvas {
  height: clamp(300px, 32vw, 340px) !important;
}

.calculator-chart-card canvas {
  display: block;
  height: 260px !important;
  max-height: 260px;
}

.calculator-chart-card figcaption,
.calculator-recent-list small {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

.calculator-insight-box ul,
.calculator-key-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.calculator-chart-legend,
.calculator-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.calculator-chart-legend .item,
.calculator-legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink-strong);
}

.calculator-chart-legend .key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.calculator-chart-legend .pct {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.calculator-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calculator-chart-legend.sugar-chart-legend,
.notes-view .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend,
.notes-editor .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend {
  flex-wrap: nowrap;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  gap: 6px;
}

.calculator-chart-legend.sugar-chart-legend .item,
.notes-view .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend .item,
.notes-editor .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend .item {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 33.333%;
  gap: 6px;
  padding-inline: 8px;
}

.calculator-chart-legend.sugar-chart-legend .name,
.notes-view .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend .name,
.notes-editor .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-chart-legend.sugar-chart-legend .key,
.calculator-chart-legend.sugar-chart-legend .pct,
.notes-view .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend .key,
.notes-view .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend .pct,
.notes-editor .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend .key,
.notes-editor .calculator-notes-chart .calculator-chart-legend.sugar-chart-legend .pct {
  flex: 0 0 auto;
}

.calculator-key-box {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.calculator-key-box ul {
  margin: 0;
  padding-left: 18px;
}

.calculator-inline-row,
.calculator-mini-list,
.calculator-list-stack,
.calculator-selection-list,
.calculator-dynamic-list,
.calculator-ingredient-list {
  display: grid;
  gap: 10px;
}

.calculator-inline-row {
  gap: 12px;
}

.calculator-inline-actions,
.calculator-inline-toolbar,
.calculator-result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.calculator-inline-toolbar {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.calculator-inline-toolbar .calculator-ghost-button {
  min-width: 104px;
}

.calculator-inline-note,
.calculator-selection-detail,
.calculator-dynamic-meta span,
.calculator-ingredient-meta span,
.calculator-list-item span,
.calculator-mini-card span,
.calculator-guide-figure figcaption {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.calculator-result-toolbar {
  justify-content: space-between;
}

.paint-opening-builder {
  gap: 12px;
}

.paint-opening-builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.paint-opening-builder-head span {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
}

.paint-opening-list {
  display: grid;
  gap: 10px;
}

.paint-opening-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.paint-opening-row .calculator-ghost-button {
  min-width: 88px;
}

.calculator-unit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.calculator-selection-list {
  grid-template-columns: 1fr;
  gap: 12px;
}

.calculator-list-item,
.calculator-selection-card,
.calculator-dynamic-card,
.calculator-ingredient-card,
.calculator-mini-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.calculator-list-item,
.calculator-selection-card,
.calculator-dynamic-card,
.calculator-ingredient-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.calculator-selection-card,
.calculator-ingredient-card {
  padding: 14px 16px;
}

.calculator-selection-meta,
.calculator-ingredient-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.calculator-dynamic-meta {
  min-width: 0;
}

.calculator-selection-title,
.calculator-dynamic-meta strong {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

.calculator-selection-title,
.calculator-ingredient-meta strong {
  color: var(--ink-strong);
  font-weight: 800;
}

.calculator-selection-actions,
.calculator-ingredient-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.calculator-color-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--calculator-dot-color, var(--brand));
}

.calculator-color-dot-0 { --calculator-dot-color: #4a6baf; }
.calculator-color-dot-1 { --calculator-dot-color: #ff6b6b; }
.calculator-color-dot-2 { --calculator-dot-color: #6bc47e; }
.calculator-color-dot-3 { --calculator-dot-color: #f4a261; }
.calculator-color-dot-4 { --calculator-dot-color: #957dad; }
.calculator-color-dot-5 { --calculator-dot-color: #e76f51; }
.calculator-color-dot-6 { --calculator-dot-color: #2a9d8f; }
.calculator-color-dot-7 { --calculator-dot-color: #e9c46a; }
.calculator-color-dot-8 { --calculator-dot-color: #3a86ff; }
.calculator-color-dot-9 { --calculator-dot-color: #ffbe0b; }
.calculator-color-dot-10 { --calculator-dot-color: #8338ec; }
.calculator-color-dot-11 { --calculator-dot-color: #fb5607; }
.calculator-color-dot-12 { --calculator-dot-color: #ff006e; }
.calculator-color-dot-13 { --calculator-dot-color: #0ead69; }
.calculator-color-dot-14 { --calculator-dot-color: #06d6a0; }
.calculator-color-dot-15 { --calculator-dot-color: #8ac926; }
.calculator-color-dot-16 { --calculator-dot-color: #7209b7; }
.calculator-color-dot-17 { --calculator-dot-color: #ffd166; }

.calculator-empty-row {
  color: var(--ink-soft);
  text-align: center;
}

.calculator-button-row.wrap-row {
  flex-wrap: wrap;
}

.calculator-guide-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.calculator-guide-figure figcaption {
  margin-top: 10px;
}

.calculator-detail-nav,
.calculator-guide-body nav[aria-label="On this page"] {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--ink-soft);
}

.calculator-detail-nav a,
.calculator-guide-body nav[aria-label="On this page"] a {
  white-space: nowrap;
}

.calculator-share-status,
.calculator-mini-section .calculator-share-grid {
  margin-top: 10px;
}

.calculator-suggestion-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.calculator-suggestion-list[hidden],
.calculator-suggestion-list:empty {
  display: none;
}

.calculator-suggestion-list button,
.calculator-suggestion-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.calculator-dialog,
.calculator-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
}

.calculator-modal {
  display: none;
}

.calculator-dialog[hidden],
.calculator-modal[hidden] {
  display: none !important;
}

.calculator-modal[open] {
  display: grid;
}

dialog.calculator-modal {
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

dialog.calculator-modal::backdrop {
  background: transparent;
}

.calculator-dialog-panel,
.calculator-modal-card {
  display: grid;
  width: min(100%, 640px);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.calculator-modal-card {
  padding: 0;
}

.calculator-modal-card > h3 {
  margin: 0;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink-strong);
  font-size: 1.15rem;
  line-height: 1.3;
}

.calculator-modal-card > .calculator-modal-grid {
  padding: 20px;
}

.calculator-dialog-head,
.calculator-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.calculator-dialog-head h2,
.calculator-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.calculator-dialog-body,
.calculator-modal-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.calculator-dialog-grid,
.calculator-modal-grid,
.calculator-modal-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calculator-dialog-grid,
.calculator-modal-grid {
  display: grid;
  gap: 14px;
}

.calculator-dialog-grid .full,
.calculator-modal-grid .full,
.calculator-modal-body .full {
  grid-column: 1 / -1;
}

.calculator-dialog-grid label,
.calculator-modal-grid label,
.calculator-modal-body label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-strong);
  font-size: 0.92rem;
  font-weight: 650;
}

.calculator-dialog-grid input,
.calculator-modal-grid input,
.calculator-modal-body input,
.calculator-modal-body select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--panel);
  color: var(--ink-strong);
  font: inherit;
}

.calculator-dialog-grid input:focus,
.calculator-modal-grid input:focus,
.calculator-modal-body input:focus,
.calculator-modal-body select:focus {
  border-color: var(--brand);
  outline: 3px solid color-mix(in srgb, var(--brand) 22%, transparent);
}

.calculator-dialog-actions,
.calculator-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px 20px;
}

.calculator-modal-actions {
  border-top: 1px solid var(--line);
}

.calculator-mini-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.calculator-mini-section h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1rem;
}

.calculator-recent-list {
  display: grid;
  gap: 8px;
}

.calculator-recent-list > .calculator-mini-card {
  background: var(--panel);
}

.calculator-share-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.calculator-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink-strong);
  text-decoration: none;
  cursor: pointer;
}

.calculator-icon-button img,
.calculator-icon-button svg {
  width: 22px;
  height: 22px;
  display: block;
}

.calculator-icon-button.brand {
  border: 0;
}

.calculator-icon-button.x,
.calculator-icon-button.threads {
  background: #111;
}

.calculator-icon-button.fb {
  background: #1877f2;
}

.calculator-icon-button.naver {
  background: #03c75a;
}

.calculator-howto {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.calculator-howto li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.calculator-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 12%, var(--panel) 88%);
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--brand) 12%, transparent);
}

.calculator-howto li:nth-child(2n) .calculator-step {
  border-color: color-mix(in srgb, #7c3aed 22%, transparent);
  background: color-mix(in srgb, #7c3aed 12%, var(--panel) 88%);
  color: #6d28d9;
}

.calculator-howto li:nth-child(3n) .calculator-step {
  border-color: color-mix(in srgb, #10b981 22%, transparent);
  background: color-mix(in srgb, #10b981 12%, var(--panel) 88%);
  color: #047857;
}

.calculator-howto li:nth-child(4n) .calculator-step {
  border-color: color-mix(in srgb, #f59e0b 24%, transparent);
  background: color-mix(in srgb, #f59e0b 14%, var(--panel) 86%);
  color: #b45309;
}

.calculator-howto h3,
.calculator-faq h3 {
  margin: 0 0 4px;
  color: var(--ink-strong);
  font-size: 1rem;
}

.calculator-howto p,
.calculator-faq p {
  margin: 0;
}

.calculator-guide-body {
  display: grid;
  gap: 20px;
  min-width: 0;
  margin-top: 14px;
}

.calculator-guide-body article,
.calculator-faq details,
.calculator-related-card {
  min-width: 0;
}

.calculator-guide-body article {
  max-width: 920px;
  margin-inline: auto;
}

.calculator-guide-body h3 {
  margin: 28px clamp(14px, 2.4vw, 28px) 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-strong);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.3;
}

.calculator-guide-body h3:first-of-type {
  margin-top: 24px;
}

.calculator-guide-body h4 {
  margin: 22px clamp(14px, 2.4vw, 28px) 10px;
  color: var(--ink-strong);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.35;
}

.calculator-guide-body p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.72;
}

.calculator-guide-body h3 ~ p,
.calculator-guide-body h3 ~ ul,
.calculator-guide-body h3 ~ ol,
.calculator-guide-body h4 ~ p,
.calculator-guide-body h4 ~ ul,
.calculator-guide-body h4 ~ ol,
.calculator-guide-body h3 ~ .calculator-table-wrap,
.calculator-guide-body h3 ~ .calculator-formula-box,
.calculator-guide-body h3 ~ .calculator-guide-figure {
  margin-left: clamp(14px, 2.4vw, 28px);
  margin-right: clamp(14px, 2.4vw, 28px);
}

.calculator-guide-body strong {
  color: var(--ink-strong);
  font-weight: 750;
}

.calculator-guide-body ul,
.calculator-guide-body ol {
  margin: 0 0 18px;
  padding-left: calc(1rem + clamp(8px, 1.2vw, 16px));
  color: var(--ink-soft);
  line-height: 1.7;
}

.calculator-guide-body li::marker {
  color: var(--brand);
}

.calculator-guide-body nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 24px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink-soft);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.calculator-guide-body nav::before {
  content: "On this page";
  display: block;
  flex: 0 0 100%;
  margin-bottom: 4px;
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.calculator-guide-body nav a,
.calculator-guide-body a {
  color: var(--brand);
  overflow-wrap: anywhere;
}

.calculator-guide-body nav a {
  display: block;
  border-radius: 6px;
  padding: 2px 5px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-decoration: none;
}

.calculator-guide-body nav a:hover {
  background: var(--panel);
  color: var(--brand);
}

.calculator-guide-body nav.calculator-guide-toc {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  overflow: visible;
  white-space: normal;
}

.calculator-guide-body nav.calculator-guide-toc::before {
  content: none;
}

.calculator-guide-toc-title {
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
}

.calculator-guide-toc-track {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 10px;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  line-height: 1.15;
}

.calculator-guide-toc-track::-webkit-scrollbar {
  display: none;
}

.calculator-guide-body .calculator-guide-toc-track a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 4px 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: normal;
}

.calculator-guide-body .calculator-guide-toc-track a:hover {
  color: var(--brand);
  background: transparent;
}

.calculator-guide-toc-separator {
  flex: 0 0 auto;
  color: var(--brand);
  font-weight: 700;
}

.calculator-guide-body .calculator-table-wrap {
  margin: 16px 0 22px;
}

.calculator-guide-figure {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 18px auto 24px;
}

.calculator-guide-figure img {
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.calculator-guide-figure figcaption {
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

.calculator-page .calculator-guide-figure[data-page-og-image] {
  width: 100%;
  margin: 0 0 24px;
  justify-items: stretch;
}

.calculator-page .calculator-guide-figure[data-page-og-image] img {
  width: 100%;
  max-width: none;
}

.calculator-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
  color: var(--ink-soft);
  line-height: 1.65;
}

.calculator-guide-body .calculator-note {
  margin: 16px clamp(14px, 2.4vw, 28px) 18px;
}

.calculator-faq {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.calculator-faq details {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.calculator-faq summary {
  cursor: pointer;
  padding: 12px;
  color: var(--ink-strong);
  font-weight: 700;
}

.calculator-faq details > div {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.calculator-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.calculator-related-share {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.calculator-related-share h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1rem;
  text-align: center;
}

.calculator-related-share .calculator-share-grid {
  justify-content: center;
}

.scroll-top-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 52px;
  border: 1px solid color-mix(in oklab, var(--line), transparent 5%);
  border-radius: 15px;
  background: color-mix(in oklab, var(--panel), white 8%);
  color: color-mix(in oklab, var(--ink-soft), #536073 25%);
  box-shadow: 0 10px 28px rgba(31, 35, 40, 0.16);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.scroll-top-button[hidden] {
  display: inline-flex !important;
}

.scroll-top-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scroll-top-button.is-visible {
  opacity: 0.86;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-button:hover,
.scroll-top-button:focus-visible {
  border-color: color-mix(in oklab, var(--brand), transparent 40%);
  background: var(--panel);
  color: var(--brand);
  box-shadow: 0 12px 32px rgba(31, 35, 40, 0.2);
  opacity: 1;
}

.calculator-related-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
  background: var(--panel);
}

.calculator-related-card strong {
  display: block;
  color: var(--ink-strong);
  line-height: 1.35;
}

.calculator-related-card span {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}


.calculator-form,
.calculator-form .calculator-field,
.calculator-form input,
.calculator-form select,
.calculator-form textarea,
.calculator-result,
.calculator-result * {
  min-width: 0;
  box-sizing: border-box;
}

.calculator-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.calculator-chart-card {
  width: 100%;
}

.calculator-chart-card canvas {
  width: 100% !important;
  max-width: none;
  height: 280px !important;
  max-height: 280px;
}

.calculator-step-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: calculator-step;
}

.calculator-step-list li {
  counter-increment: calculator-step;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, var(--brand) 6%);
}

.calculator-step-list li::before {
  content: counter(calculator-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(56, 97, 251, .18);
}

.calculator-step-list b {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-strong);
}

.calculator-step-list span {
  color: var(--ink-soft);
  line-height: 1.55;
}

.calculator-fold-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.calculator-fold-details summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--ink-strong);
  font-weight: 800;
  list-style: none;
}

.calculator-fold-details summary::-webkit-details-marker {
  display: none;
}

.calculator-fold-details summary::after {
  content: '+';
  float: right;
  color: var(--brand);
  font-weight: 900;
}

.calculator-fold-details[open] summary::after {
  content: '-';
}

.calculator-fold-details .calculator-table-wrap {
  padding: 0 12px 12px;
}

.calculator-scroll-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calculator-scroll-table table {
  min-width: 640px;
}

@media (max-width: 768px) {
  .calculator-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .calculator-form > .calculator-field.full,
  .calculator-form > .calculator-input-card,
  .calculator-form > .calculator-tab-panel,
  .calculator-form > .calculator-mode-inputs,
  .calculator-form > .calculator-form-separator,
  .calculator-form > .calculator-error.full {
    grid-column: 1 / -1;
  }

  .calculator-result-grid,
  .calculator-result-highlight-grid {
    grid-template-columns: 1fr;
  }

  .calculator-chart-grid {
    grid-template-columns: 1fr;
  }

  .calculator-chart-card canvas {
    height: 240px !important;
    max-height: 240px;
  }
}

@media (max-width: 640px) {
  .calculator-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calculator-form label {
    font-size: .82rem;
    line-height: 1.25;
  }

  .calculator-form input {
    padding-inline: 10px;
  }
}

@media (max-width: 900px) {
  .calculator-grid:has(.calculator-aside) {
    grid-template-columns: 1fr;
  }

  .post-page .calculator-grid:has(.calculator-aside) {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-page .calculator-main,
  .post-page .calculator-aside,
  .post-page .calculator-panel,
  .post-page .calculator-related-section,
  .post-page .calculator-aside-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

@media (max-width: 640px) {
  .repo-subtitle {
    display: none;
  }

  .calculator-page {
    width: min(100% - 20px, 1280px);
    padding-inline: 0;
  }

  .post-page {
    width: min(100% - 20px, 1440px);
  }

  .post-page .calculator-aside-search,
  .post-page .search-frame,
  .post-page .search-frame input,
  .post-page .post-article-body,
  .post-page .post-article-body figure,
  .post-page .post-article-body img,
  .post-page .post-article-body iframe,
  .post-page .post-article-body video {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .post-page .post-article-body {
    overflow-wrap: anywhere;
  }

  .post-page .post-article-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .post-page .post-author-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .post-page .post-author-card img {
    width: 52px;
    height: 52px;
  }

  .post-page .calculator-aside {
    position: static;
  }

  .calculator-panel,
  .calculator-guide-section,
  .calculator-related-section,
  .calculator-aside-section {
    padding: 14px;
  }

  .calculator-grid,
  .calculator-main,
  .calculator-panel,
  .calculator-form,
  .calculator-input-card,
  .calculator-input-card-head,
  .calculator-field,
  .calculator-input-with-unit,
  .calculator-result,
  .calculator-result-toolbar,
  .calculator-table-wrap,
  .calculator-chart-card,
  .calculator-inline-row,
  .calculator-inline-actions,
  .calculator-list-item,
  .calculator-selection-card,
  .calculator-dynamic-card,
  .calculator-ingredient-card {
    max-width: 100%;
    min-width: 0;
  }

  .calculator-result-grid,
  .calculator-chart-grid,
  .calculator-formula-row,
  .calculator-field-row {
    grid-template-columns: 1fr;
  }

  .calculator-form {
    grid-template-columns: 1fr;
  }

  .calculator-settings-subhead {
    margin: 18px 8px 8px;
  }

  .calculator-result-highlight-card {
    padding: 12px 14px;
  }

  .calculator-result-highlight-card strong {
    font-size: clamp(1rem, 5vw, 1.22rem);
  }

  .paint-opening-builder-head,
  .paint-opening-row {
    grid-template-columns: 1fr;
  }

  .paint-opening-builder-head {
    display: grid;
  }

  .paint-opening-row .calculator-ghost-button {
    width: 100%;
  }

  .calculator-mode-inputs {
    flex-direction: column;
  }

  .calculator-input-card {
    padding: 12px;
  }

  .calculator-field input,
  .calculator-field select,
  .calculator-field textarea {
    max-width: 100%;
    min-width: 0;
  }

  .calculator-formula-row code {
    white-space: normal;
  }

  .calculator-input-card-head {
    display: grid;
  }

  .calculator-input-card-head p,
  .calculator-inline-note,
  .calculator-result-toolbar,
  .calculator-list-item,
  .calculator-selection-card,
  .calculator-dynamic-card,
  .calculator-ingredient-card {
    overflow-wrap: anywhere;
  }

  .calculator-method-select {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .calculator-helper-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .calculator-helper-actions .calculator-ghost-button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

  .calculator-button,
  .calculator-ghost-button {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .calculator-chart-card canvas {
    max-width: 100%;
  }

  .calculator-guide-body article {
    max-width: 100%;
  }

  .calculator-guide-body h3 {
    margin: 24px 8px 10px;
  }

  .calculator-guide-body h3 ~ p,
  .calculator-guide-body h3 ~ ul,
  .calculator-guide-body h3 ~ ol,
  .calculator-guide-body h3 ~ .calculator-table-wrap,
  .calculator-guide-body h3 ~ .calculator-guide-figure {
    margin-left: 8px;
    margin-right: 8px;
  }

  .calculator-guide-body ul,
  .calculator-guide-body ol {
    padding-left: calc(1.2rem + 8px);
  }

  .calculator-guide-body nav {
    gap: 3px 6px;
    padding: 8px;
  }

  .calculator-guide-body nav a {
    padding: 1px 4px;
    font-size: 0.82rem;
  }

  .calculator-guide-body nav.calculator-guide-toc {
    margin-left: -8px;
    margin-right: -8px;
    overflow: hidden;
  }

  .calculator-guide-toc-track {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .calculator-table {
    min-width: 480px;
  }

  .calculator-related-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .calculator-mode-tab {
    padding: 10px 8px;
    font-size: 0.8rem;
    white-space: normal;
  }

  .calculator-field.actions {
    justify-content: stretch;
  }

  .calculator-action-stack {
    width: 100%;
  }

  .calculator-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calculator-field.actions .calculator-button,
  .calculator-field.actions .calculator-ghost-button {
    width: 100%;
  }

  .calculator-helper-note {
    text-align: right;
  }

  .calculator-button-row .calculator-ghost-button {
    flex: 1 1 calc(50% - 4px);
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
}

@media print {
  .calculator-actions,
  .calculator-button-row,
  .calculator-related-section {
    display: none !important;
  }

  .calculator-panel,
  .calculator-guide-section {
    box-shadow: none;
  }
}
