/* Shared tool design. Logical properties preserve RTL and bilingual numeric fields.
   Semantic colors follow the existing light/dark theme; calculation code is separate. */
.palst-tool-page {
	--tool-radius: 24px;
	--tool-border: color-mix(in srgb, var(--ink) 14%, var(--surface));
	--tool-field-border: color-mix(in srgb, var(--ink) 50%, var(--surface));
}
.palst-tool-page .page-wrap { max-width: 1040px; }
.palst-tool-page .page-head { padding-block-end: 24px; margin-block-end: 12px; border-bottom: 1px solid var(--line); }
.palst-tool-page :is(.page-head, .a-head) h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.5; max-width: 900px; margin-block: 14px; }
.tool-back { display: inline-flex; align-items: center; gap: 12px; color: var(--green); font: 500 14px/1.6 var(--display); padding-block: 8px; text-decoration: none; }
.tool-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.palst-tool-page .page-prose { font-size: 17px; line-height: 1.9; }
.palst-tool-page .page-prose > p:first-child { font-size: 18px; max-width: 80ch; }
:is(.cost-calc, .bluecard-calc, .netto-calc, .days-calc, .perm-calc, .kolleg-calc, .visa-check, .lid) {
	border: 1px solid var(--tool-border, var(--line));
	border-radius: var(--tool-radius, 24px);
	background: var(--surface);
	padding: clamp(20px, 3vw, 32px);
	box-shadow: 0 4px 24px -12px color-mix(in srgb, var(--ink) 18%, transparent);
	margin-block: 28px 36px;
}
.tool-panel-head { border-bottom: 1px solid var(--line); padding-block-end: 22px; margin-block-end: 24px; }
.tool-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font: 500 12px/1.6 var(--display); background: var(--green-soft); padding: 5px 12px; border-radius: 999px; }
.tool-kicker::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.prose .tool-panel-head h2 { margin-block: 12px 6px; font: 600 clamp(21px, 2.5vw, 27px)/1.5 var(--display); }
.prose .tool-panel-head p { margin: 0; color: var(--muted); font-size: 15px; }
:is(.cc-row, .bc-grid, .nt-grid, .pm-grid, .kc-grid) { gap: 22px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.cc-lines { gap: 20px 24px; }
:is(.cost-calc, .bluecard-calc, .netto-calc, .days-calc, .perm-calc, .kolleg-calc, .visa-check) label { gap: 8px; min-width: 0; }
:is(.cost-calc, .bluecard-calc, .netto-calc, .days-calc, .perm-calc, .kolleg-calc, .visa-check) label > span { color: var(--ink); font: 500 14px/1.7 var(--display); }
.palst-tool-page :is(.cost-calc, .bluecard-calc, .netto-calc, .days-calc, .perm-calc, .kolleg-calc, .visa-check, .lid, .dfind, .doc-finder) :is(input:not([type=checkbox]), select) {
	min-width: 0; width: 100%; min-height: 52px; border-radius: 12px; border: 1px solid var(--tool-field-border);
	background: var(--bg); color: var(--ink); padding: 12px 14px; font: 400 16px/1.6 var(--body);
}
.palst-tool-page :is(input[type=number], input[type=date]) { direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
.palst-tool-page input::placeholder { color: var(--muted); opacity: 1; }
.palst-tool-page :is(input, select, button, summary, a):focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.palst-tool-page :is(.cost-calc, .bluecard-calc, .netto-calc, .days-calc, .perm-calc, .kolleg-calc, .visa-check) :is(input, select):focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 15%, transparent); }
/* Units follow the RTL label's inline start (right); numeric inputs reserve
   their LTR inline end (also right). Keep both directions on the same edge. */
:is(.cc-lines, .nt-kvz) input { padding-inline-end: 36px !important; }
:is(.cc-lines, .nt-kvz) em { inset-inline-start: 14px; inset-inline-end: auto; bottom: 26px; transform: translateY(50%); font: 400 16px/1 var(--body); pointer-events: none; }
.bc-in { grid-template-columns: minmax(0, 2fr) minmax(110px, 1fr); }
.prose :is(.tool-section-title, .tool-result-title) { font: 600 16px/1.6 var(--display); margin: 0; }
.pm-grid > .tool-section-title { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-block: 10px; margin-block-start: 8px; }
.pm-grid > .tool-section-title:first-child { margin-block-start: 0; padding-block-start: 0; }
.prose .tool-result-title { margin-block: 28px 12px; display: flex; align-items: center; gap: 10px; }
.tool-result-title::before { content: ''; width: 4px; height: 20px; border-radius: 4px; background: var(--brand); }
:is(.cc-out, .nt-out, .dy-out, .bc-out, .kc-out) { margin-top: 0; border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--surface-2); }
.pm-out { margin-top: 0; gap: 16px; }
.pm-card { padding: 22px; border: 1px solid var(--line); border-inline-start: 4px solid var(--green); border-radius: 16px; background: var(--surface-2); }
.prose .pm-title { font: 600 17px/1.6 var(--display); }
.prose .pm-date { margin-block: 8px 12px; font: 600 21px/1.6 var(--display); }
.prose .pm-out li { line-height: 1.8; }
.prose .pm-note { color: var(--muted); line-height: 1.8; }
.prose .pm-out details { border-radius: 16px; background: var(--surface); padding: 6px 18px; }
.prose .pm-out details .pm-card { border: 0; padding-block: 12px; }
.prose .pm-out summary { padding-block: 16px; font-size: 15px; }
.cc-total { flex-wrap: wrap; align-items: baseline; gap: 10px; }
.cc-total b { font-size: clamp(28px, 4vw, 40px); color: var(--green); }
.cc-bar, .vc-bar { height: 8px; }
.prose .nt-table { background: var(--surface); border-radius: 12px; overflow: hidden; margin-top: 18px; }
.prose .nt-table :is(th, td) { padding: 12px; }
.prose .nt-table .nt-net { background: var(--green-soft); }
.prose .dy-row { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-block-end: 14px; gap: 12px; }
:is(.dy-btn, .vc-print) { background: var(--green); color: var(--surface); min-height: 48px; padding: 12px 18px; }
.dy-del { border: 1px solid var(--line); background: var(--surface); }
.dy-del:hover { color: var(--red-text); background: var(--red-soft); }
.dy-btn:hover, .vc-print:hover { background: var(--green); filter: brightness(.93); }
.visa-check { position: static; z-index: auto; }
.vc-top { gap: 20px; }
.vc-prog { margin-top: 20px; }
.prose .visa-list.is-enhanced > li { padding-block: 18px; padding-inline-end: 18px; padding-inline-start: 58px; border-radius: 16px; margin-block-end: 12px; }
.prose .visa-list.is-enhanced > li { cursor: pointer; }
.prose .visa-list.is-enhanced > li:hover { border-color: var(--green); }
.visa-list .vc-cb { inset-inline-start: 20px; top: 22px; width: 24px; height: 24px; }
.prose .js-vc-note { display: grid; gap: 6px; list-style: none; margin: 14px 0 0; padding: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.prose .js-vc-note li { position: relative; margin: 0; padding-inline-start: 18px; }
.prose .js-vc-note li::before { content: ''; position: absolute; inset-inline-start: 2px; top: .75em; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.prose blockquote.has-copy { border: 1px solid var(--line); border-inline-start: 4px solid var(--brand); border-radius: 18px; padding-top: 68px; }
.copy-btn { min-height: 44px; padding: 10px 18px; top: 12px; inset-inline-end: 12px; }
.palst-tool-page .dfind { border-radius: 20px; background: var(--surface); border: 1px solid var(--tool-border); }
.palst-tool-page .doc-finder { padding: 16px; }
.palst-tool-page .dfind-count { line-height: 1.7; }
.palst-tool-page .cities { border: 0; padding: 0; background: transparent; }
.palst-tool-page .cities details { border: 1px solid var(--line); border-radius: 18px; margin-block-end: 12px; background: var(--surface); padding-inline: 20px; }
.palst-tool-page .cities summary { min-height: 64px; flex-wrap: wrap; }
.lid-tiles { gap: 16px; }
.lid-tile { min-height: 112px; border-radius: 16px; padding: 20px; }
.lid-opt { padding: 16px; border-radius: 14px; }
.lid-nav { margin: 24px 0 0; padding: 16px 0 0; border-radius: 0; }
.lid-help { padding: 20px; line-height: 1.8; }
.tools-page .page-head { border: 0; margin-block-end: 0; }
.tools-page .tools-lead { max-width: 62ch; margin-block: 12px 0; color: var(--muted); font-size: 17px; line-height: 1.9; }
.tools-afterword { margin-block: 40px 12px; padding-block-start: 28px; border-block-start: 1px solid var(--line); }
.tools-afterword h2 { margin-block: 0 10px; font: 600 22px/1.5 var(--display); }
.tools-afterword .tools-intro { line-height: 1.9; }
.tools-search { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; margin-block: 12px 28px; }
.tools-search label { display: block; font: 500 15px/1.6 var(--display); margin-block-end: 10px; }
.tools-search input { width: 100%; min-height: 52px; border: 1px solid var(--tool-field-border); border-radius: 12px; padding: 12px 16px; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--body); }
.tools-count { margin-block: 10px 0; color: var(--muted); font-size: 14px; }
.tools-empty { padding: 24px; background: var(--surface-2); border-radius: 16px; }
.tools-grid { gap: 20px; }
.tools-grid a { padding: 28px; border-radius: 22px; gap: 12px; grid-template-rows: auto auto 1fr auto; }
.tools-grid a:hover { border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-2px); }
.tools-grid h2 { font-size: 20px; line-height: 1.6; }
.tools-grid .tg-i { width: 52px; height: 52px; border-radius: 16px; background: var(--green-soft); color: var(--green); }
.tools-grid .tg-go { color: var(--green); margin-block-start: 10px; }
.tools-grid [hidden], .tools-search[hidden], .tools-empty[hidden] { display: none; }
/* Grade converter also appears on the homepage, so keep its scope independent. */
.tool:has(.js-grade) { border-radius: 24px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.tool:has(.js-grade) > div, .tool:has(.js-grade) > form { padding: clamp(22px, 3vw, 36px); padding-top: 44px; }
.tool:has(.js-grade) .calc { background: var(--surface-2); gap: 24px; }
.tool:has(.js-grade) :is(p, .hint, .fields label, .scale-l) { color: var(--muted); }
.tool:has(.js-grade) .eyebrow { color: var(--green); }
.tool:has(.js-grade) code { background: var(--bg); color: var(--ink); font-size: 13px; max-width: 100%; overflow-wrap: anywhere; }
.tool:has(.js-grade) .fields { gap: 12px; }
.tool:has(.js-grade) .fields label { color: var(--ink); font-size: 14px; min-width: 0; }
.tool:has(.js-grade) .fields input[type=number]:not([type=submit]) { min-height: 52px; width: 100%; background: var(--surface); color: var(--ink); border-color: color-mix(in srgb, var(--ink) 50%, var(--surface)); direction: ltr; }
.tool:has(.js-grade) .fields input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.tool:has(.js-grade) .result b { color: var(--green); }
.tool:has(.js-grade) .hint { line-height: 1.85; }
@media (max-width: 720px) {
	.palst-tool-page .page-head { padding-block-end: 18px; }
	.palst-tool-page :is(.page-head, .a-head) h1 { font-size: 28px; }
	:is(.cc-row, .bc-grid, .nt-grid, .pm-grid, .kc-grid) { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.cc-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
	:is(.cost-calc, .bluecard-calc, .netto-calc, .days-calc, .perm-calc, .kolleg-calc, .visa-check, .lid) { padding: 20px; border-radius: 20px; margin-inline: 0; }
	.tool-panel-head { padding-block-end: 18px; margin-block-end: 20px; }
	.pm-card { padding: 18px; }
	:is(.cc-out, .nt-out, .dy-out, .bc-out, .kc-out) { padding: 16px; }
	.prose .nt-table :is(th, td) { padding: 10px 6px; }
	.lid-tile { padding: 16px; }
	.lid-tile b { font-size: 16px; }
	.lid-nav { flex-wrap: wrap; }
	.tools-search, .tools-grid a { padding: 20px; }
	.tools-page .tools-lead { font-size: 16px; line-height: 1.8; }
	.tools-afterword { margin-block-start: 32px; }
	.tool:has(.js-grade) .fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.palst-tool-page *, .tool:has(.js-grade) * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
	.tool-back, .tools-search, .tool-panel-head, .tool-result-title { display: none; }
	:is(.cost-calc, .bluecard-calc, .netto-calc, .days-calc, .perm-calc, .kolleg-calc, .visa-check, .lid) { box-shadow: none; border: 1px solid #bbb; }
	.pm-card { break-inside: avoid; }
}

/* Date shortcuts are explicit one-time copies: different dates remain editable. */
.pm-date-field { min-width: 0; align-self: start; }
.pm-date-field label { display: grid; }
.pm-date-help { display: block; color: var(--muted); font-size: 13px; line-height: 1.7; margin-block: 8px; }
.pm-copy-date { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--green-soft); color: var(--ink); font: 500 13px/1.6 var(--display); cursor: pointer; }
.pm-copy-date:hover:not(:disabled) { border-color: var(--green); }
.pm-copy-date:disabled { opacity: .5; cursor: default; }
.pm-field-error { display: block; color: var(--red); font-size: 13px; line-height: 1.7; margin-block-start: 8px; }
.palst-tool-page .pm-date-field input[aria-invalid=true] { border-color: var(--red); }
.palst-tool-page .pm-date-field input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; box-shadow: none; }

/* This questionnaire is a sequence: conditional answers reveal the next
   relevant question. A two-column auto-flow broke its reading order in RTL. */
.pm-grid {
	grid-template-columns: minmax(0, 1fr);
	align-items: stretch;
	gap: 16px;
	max-width: 720px;
	margin-inline: auto;
}
.pm-grid > .tool-section-title {
	grid-column: auto;
	margin-block: 26px 0;
	padding-block: 0 12px;
	font-size: 18px;
}
.pm-grid > .tool-section-title:first-child { margin-block-start: 0; }
.pm-grid > :is(label, .pm-date-field) {
	min-width: 0;
	padding: 18px 20px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--bg);
}
.pm-grid > .pm-date-field { align-self: stretch; }
.pm-grid > .pm-pension.pm-help {
	margin-block: -8px 0;
	padding-inline: 20px;
}
.pm-grid :is(label, .pm-date-help, .pm-field-error) { text-wrap: pretty; }
@media (max-width: 720px) {
	.pm-grid { gap: 12px; }
	.pm-grid > .tool-section-title { margin-block-start: 24px; }
	.pm-grid > :is(label, .pm-date-field) { padding: 14px; }
	.pm-grid > .pm-pension.pm-help { padding-inline: 14px; }
}
