/* CALC.WS public tools: shared visual foundation. See docs/TOOL_DESIGN_SYSTEM.md.
   Keep the site header/footer outside .cw-tool. Load page overrides after this file. */
.cw-tool {
    --cw-primary: #0f0fff;
    --cw-hover: #050a99;
    --cw-ink: #222837;
    --cw-muted: #58667a;
    --cw-border: #dfe5ee;
    --cw-paper: #f6f7fa;
    --cw-pale: #f0f3ff;
    --cw-dark: #202631;
    --cw-gradient: linear-gradient(132.6deg, #0f0fff 35.26%, #161cba 74.23%);
    width: calc(100% - 32px);
    max-width: 1200px;
    margin: 0 auto 56px;
    color: var(--cw-ink);
    font: 400 17px/1.56 "PT Sans", Arial, sans-serif;
}
.cw-tool, .cw-tool *, .cw-tool *::before, .cw-tool *::after { box-sizing: border-box; }
.cw-tool [hidden] { display: none !important; }
.cw-tool h1, .cw-tool h2, .cw-tool h3, .cw-tool p { margin-top: 0; }
.cw-tool p { margin-bottom: 14px; }
.cw-tool a { color: var(--cw-primary); }
.cw-tool a:hover { color: var(--cw-hover); }
.cw-tool :is(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid #0f0fff66; outline-offset: 4px; }
.cw-tool__hero { margin: 22px 0 24px; }
.cw-tool__hero h1 { margin-bottom: 9px; font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -.035em; }
.cw-tool__hero p { margin-bottom: 0; color: var(--cw-muted); }
.cw-tool__panel { padding: 28px 30px 24px; border: 1px solid var(--cw-border); border-radius: 13px; background: #fff; }
.cw-tool__panel h2 { margin-bottom: 20px; font-size: 23px; font-weight: 700; line-height: 1.25; letter-spacing: -.016em; }
.cw-tool__panel:focus-within { border-color: #a4a9ff; box-shadow: 0 0 0 3px #0f0fff0a; }
.cw-tool__form { display: grid; gap: 18px; }
.cw-tool__row { display: flex; align-items: flex-end; gap: 12px; min-width: 0; }
.cw-tool__field { display: grid; flex: 1; min-width: 0; gap: 9px; }
.cw-tool__label { margin: 0; color: var(--cw-muted); font-size: 14px; font-weight: 700; }
.cw-tool__input { width: 100%; min-width: 0; min-height: 56px; margin: 0; padding: 14px 16px; border: 1px solid #ccd5e4; border-radius: 7px; color: var(--cw-ink); background: #fff; font: inherit; font-size: 16px; line-height: 1.4; }
.cw-tool__input:focus { border-color: var(--cw-primary); }
.cw-tool__input::placeholder { color: #8290a3; opacity: 1; }
.cw-tool .cw-tool__button { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 14px 22px; border: 1px solid transparent; border-radius: 7px; color: #fff; background: var(--cw-primary); background-image: var(--cw-gradient); font: inherit; font-size: 16px; font-weight: 700; line-height: 1.4; text-align: center; text-decoration: none; cursor: pointer; transition: background .2s, box-shadow .2s; }
.cw-tool .cw-tool__button:hover { color: #fff; background: var(--cw-hover); box-shadow: 0 8px 19px #0f0fff20; }
.cw-tool .cw-tool__button:disabled { opacity: .48; cursor: default; box-shadow: none; }
.cw-tool .cw-tool__button--secondary { border-color: var(--cw-border); color: var(--cw-ink); background: #fff; }
.cw-tool .cw-tool__button--secondary:hover { color: var(--cw-primary); background: var(--cw-pale); box-shadow: none; }
.cw-tool .cw-tool__hint { margin: 0; color: var(--cw-muted); font-size: 13px; line-height: 1.5; }
.cw-tool__result { margin-top: 24px; padding: 24px; border: 1px solid #dfe4fd; border-radius: 13px; background: var(--cw-pale); overflow-wrap: anywhere; }
.cw-tool__result-value { display: block; color: var(--cw-ink); font-size: clamp(28px, 4vw, 42px); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cw-tool__message { margin: 18px 0; padding: 15px 18px; border: 1px solid var(--cw-border); border-radius: 7px; color: var(--cw-ink); background: var(--cw-paper); overflow-wrap: anywhere; }
.cw-tool__message--error { border-color: #e7c5c5; color: #8f2929; background: #fff5f5; }
.cw-tool__section { margin-top: 56px; }
.cw-tool__section h2 { margin-bottom: 16px; font-size: clamp(29px, 3.4vw, 45px); font-weight: 700; line-height: 1.12; letter-spacing: -.035em; }
.cw-tool__section h3 { margin-bottom: 9px; font-size: clamp(19px, 2vw, 24px); line-height: 1.25; letter-spacing: -.016em; }
.cw-tool__section p { color: var(--cw-muted); }
.cw-tool__caption { display: block; margin-bottom: 16px; color: var(--cw-primary); font: 700 12px/1.3 Consolas, monospace; letter-spacing: .055em; text-transform: uppercase; }
.cw-tool__faq-item { border-bottom: 1px solid var(--cw-border); }
.cw-tool__faq-item summary { padding: 19px 0; font-weight: 700; cursor: pointer; }
.cw-tool__faq-item p { padding-bottom: 19px; margin-bottom: 0; font-size: 16px; }
.cw-tool__table-scroll { max-width: 100%; overflow: auto; }
@media (max-width: 760px) {
    .cw-tool__hero { margin-top: 18px; }
    .cw-tool__hero h1 { font-size: 28px; line-height: 1.18; }
    .cw-tool__hero p { font-size: 16px; }
    .cw-tool__panel { padding: 23px 20px 21px; border-radius: 12px; }
    .cw-tool__panel h2 { margin-bottom: 18px; font-size: 21px; }
    .cw-tool__row { flex-direction: column; align-items: stretch; gap: 10px; }
    .cw-tool__input, .cw-tool .cw-tool__button { min-height: 54px; }
    .cw-tool .cw-tool__row > .cw-tool__button { width: 100%; }
}
@media (max-width: 650px) {
    .cw-tool { width: calc(100% - 24px); margin-bottom: 36px; font-size: 16px; }
    .cw-tool__section { margin-top: 46px; }
    .cw-tool__section h2 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
    .cw-tool .cw-tool__button { transition: none; }
}
