/* Калькуляторы ведических наук (Васту, Анка …) — новый стиль «Моя Ведическая карта».
   Цвета отметок мандалы и плана — как в Академии. */
.system-form, .system-result {display:none;}
body[data-system]:not([data-system="jyotish"]) #jyotish-chart-panel {display:none !important;}
/* Измеряем форму Джйотиш в её колонке и на прямых ссылках в другие разделы. */
body[data-system]:not([data-system="jyotish"]) #birth-panel {
  position:absolute;grid-column:1/2;grid-row:1/2;inset:0 0 auto;
  visibility:hidden;pointer-events:none;
}
body[data-system="vastu"] #vastu-panel, body[data-system="numerology"] #numerology-panel {display:block;}
body[data-system="vastu"] #vastu-result-panel, body[data-system="numerology"] #numerology-result-panel {display:flex;flex-direction:column;gap:12px;}
body[data-system] .workspace[data-expanded] .system-form {display:none !important;}

.vs-group {display:grid;gap:8px;margin:0;padding:0;border:0;min-width:0;}
.vs-group legend {padding:0;margin-bottom:3px;}
.vs-hint,.vs-tips p {margin:0 0 8px;font:400 12px/16px Inter,sans-serif;color:hsl(var(--muted-foreground));}
.vs-room {display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr) 24px;gap:4px;align-items:center;}
.vs-room button {width:24px;height:24px;border:1px solid #dac9a7;border-radius:6px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font-size:14px;line-height:1;cursor:pointer;}
.vs-room button:hover {color:#b23b3b;border-color:#b23b3b;}
#vRooms {display:grid;gap:4px;}
#vRooms:empty {display:none;}
.vs-add-row {min-height:28px;border:1px dashed #c5ae84;border-radius:8px;background:transparent;color:var(--focus);font:500 12px/16px Inter,sans-serif;cursor:pointer;}
.vs-add-row:hover {border-style:solid;background:hsl(var(--secondary));}
@media(min-width:1180px){
 .system-form {min-height:600px;}
 body[data-system="vastu"] #vastu-panel, body[data-system="numerology"] #numerology-panel {display:flex;flex-direction:column;}
 .system-form .vs-form {flex:1;align-content:start;}
}

/* Центр: план, карта Раши, отчёт */
.system-result {padding:16px;}
.vs-card {border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));padding:0 14px;}
.vs-card > summary {min-height:40px;display:flex;align-items:center;cursor:pointer;font:italic 500 14px/18px var(--display);color:hsl(var(--foreground));}
.vs-card[open] > summary {border-bottom:1px solid hsl(var(--border));margin-bottom:10px;}
.vs-card[open] {padding-bottom:12px;}
.vs-card .vs-hint {margin-bottom:10px;}
.vs-file {position:relative;overflow:hidden;min-height:32px;padding:4px 14px;font-size:12px;cursor:pointer;}
.vs-file input {position:absolute;inset:0;opacity:0;cursor:pointer;}
#vPhotoWrap {display:grid;gap:8px;margin-top:10px;}
#vPhotoWrap[hidden] {display:none;}
#vCanvas {display:block;width:100%;max-width:620px;border:1px solid hsl(var(--border));border-radius:10px;background:#fff;cursor:crosshair;touch-action:none;}
.vs-range {font:400 12px/16px Inter,sans-serif;}
.vs-range input {width:100%;min-height:24px;padding:0;border:0;background:none;accent-color:hsl(var(--accent));}
.vs-modes {display:flex;gap:6px;}
.vs-modes button {flex:1;min-height:32px;border:1px solid #dac9a7;border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:500 12px/16px Inter,sans-serif;cursor:pointer;}
.vs-modes button:hover {border-color:#bba682;color:hsl(var(--foreground));}
.vs-modes button.on {background:var(--action);border-color:var(--action);color:var(--action-text);}
#vPhotoWrap .field select {height:32px;min-height:32px;padding:4px 8px;font-size:12px;border-radius:8px;}
#vPhotoWrap .control-row .button {min-height:32px;padding:4px 14px;font-size:12px;}
.vs-rashi-body {display:grid;gap:12px;}
.vs-rashi-chart {max-width:420px;}
.vs-rashi-body dl {display:grid;grid-template-columns:max-content 1fr;gap:4px 12px;margin:0;font-size:12.5px;line-height:1.45;}
.vs-rashi-body dt {color:hsl(var(--muted-foreground));}
.vs-rashi-body dd {margin:0;color:hsl(var(--foreground));}
@media(min-width:768px){.vs-rashi-body {grid-template-columns:minmax(0,420px) minmax(0,1fr);align-items:start;}}

.vs-result {display:grid;grid-template-columns:minmax(0,1fr);gap:10px;min-width:0;}
.vs-result > *, .vs-card, .vs-sec-body {min-width:0;}
.vs-empty {padding:48px 16px;text-align:center;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground));}
.vs-empty span {display:block;margin-bottom:8px;font:400 40px/1 var(--display);color:hsl(var(--accent));}
.vs-head h2 {font:italic 500 24px/28.8px var(--display);}
.vs-sec {border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card));}
.vs-sec > summary {display:flex;align-items:center;min-height:40px;padding:6px 14px;cursor:pointer;list-style:none;font:italic 500 14px/18px var(--display);}
.vs-sec > summary::-webkit-details-marker {display:none;}
.vs-sec > summary::after {content:'';margin-left:auto;width:8px;height:8px;border-right:1.5px solid var(--focus);border-bottom:1.5px solid var(--focus);transform:rotate(45deg);transition:transform .15s;}
.vs-sec[open] > summary::after {transform:rotate(-135deg);}
.vs-sec h3 {font:inherit;color:inherit;}
.vs-sec-body {padding:0 14px 12px;}
.vs-sec-body p {margin:0;font-size:13px;line-height:1.55;}
.vs-scroll {overflow-x:auto;}
.vs-table {table-layout:auto;min-width:420px;}
.vs-table td:first-child {min-width:110px;}
.vs-sub {margin:8px 0 0;padding-left:18px;font-size:12px;line-height:1.55;color:hsl(var(--muted-foreground));}
.vs-sub li {margin-bottom:4px;}

/* Мандала Васту-Пуруши: отметки good / mid / bad — цвета Академии */
.vs-mandala {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-width:480px;margin:4px auto;}
.vs-m-cell {min-height:86px;padding:8px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--background));min-width:0;}
.vs-m-cell h4 {margin:0 0 2px;font:600 11px/14px Inter,sans-serif;color:var(--focus);}
.vs-m-dir {margin-bottom:4px;font-size:10px;line-height:1.3;color:hsl(var(--muted-foreground));}
.vs-m-cell.center {display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:hsl(var(--secondary));}
.vs-m-item {margin:2px 0;padding:2px 6px;border-radius:6px;background:rgba(0,0,0,.05);font-size:11px;line-height:1.35;overflow-wrap:anywhere;}
.vs-m-item.good {border-left:3px solid #6fbf73;}
.vs-m-item.mid {border-left:3px solid #d2a24c;}
.vs-m-item.bad {border-left:3px solid #e57373;}
@media(max-width:767px){
 .vs-modes button, .vs-room button, .vs-add-row {min-height:44px;}
 .vs-room {grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px;}
 .vs-room button {width:44px;height:44px;}
 .vs-form select, .vs-form input:not([type=range]):not([type=file]), .vs-room select {height:40px;min-height:40px;font-size:14px;}
 .vs-form .form-actions .button {min-height:44px;}
}

/* Анка */
.vs-more {border-bottom:1px solid hsl(var(--border));padding-bottom:4px;}
.vs-more > summary {min-height:24px;padding-block:6px;font:400 12px/16px Inter,sans-serif;color:hsl(var(--muted-foreground));cursor:pointer;}
.vs-more > summary::marker {color:var(--focus);}
.vs-more[open] > summary {margin-bottom:6px;}
.vs-more .fields + .vs-hint, .vs-more .vs-hint {margin-top:6px;}
.vs-form input::placeholder {color:hsl(var(--muted-foreground));opacity:1;}
.vs-form [aria-invalid="true"] {border-color:#b23b3b;}
.field-error {margin:2px 0 0;font-size:11.5px;line-height:1.4;color:#b23b3b;}
.vs-table.vs-grid {min-width:0;width:auto;margin:0 auto;table-layout:fixed;}
.vs-table.vs-grid td {width:56px;height:44px;text-align:center;vertical-align:middle;font:600 18px/1 var(--display);}

.academy-panel {display:none;grid-column:1/-1;min-width:0;}
html:has(body:is([data-system="physiognomy"],[data-system="palmistry"])) {scrollbar-width:none;}
body[data-system="petals"] #petals-panel,
body[data-system="physiognomy"] #physiognomy-panel,
body[data-system="palmistry"] #palmistry-panel {
  display:block;padding:0;border:0;background:transparent;box-shadow:none;
}
.academy-panel .form-toolbar {justify-content:flex-start;margin-bottom:12px;}
.academy-panel .form-toolbar .button {flex:none;}
.academy-panel .form-toolbar label {display:flex;align-items:center;gap:10px;font:500 13px Inter,sans-serif;}
#petals-input .field {gap:3px;font:400 12px/16px Inter,sans-serif;color:#675e5b;}
#petals-input {width:var(--input-panel-width);}
#petals-input select {width:100%;}
#art-choice {box-sizing:border-box;height:24px;min-height:24px;min-width:0;max-width:100%;padding:2px 8px;border:1px solid var(--line-gold);border-radius:6px;background:white;color:#3a3331;font:400 12px/16px Inter,sans-serif;}
.academy-panel iframe {display:block;width:100%;height:var(--page-height,100dvh);border:0;}
.academy-panel iframe:not(.ready) {visibility:hidden;}
/* пока встроенная страница грузится, показываем строку вместо пустого места */
.academy-panel:not(:has(iframe.ready))::before {content:'Раздел загружается…';display:block;padding:24px 12px;font:400 13px/20px Inter,sans-serif;color:hsl(var(--muted-foreground));text-align:center;}
@media(min-width:1024px) and (hover:hover) and (pointer:fine) {
  .academy-panel iframe,
  :is(.academy-panel,.petals-output):has(> iframe.expanded)::after {zoom:calc(1 / .9);}
}
.academy-panel iframe.expanded {position:fixed;inset:0;z-index:1000;height:100dvh;background:hsl(var(--background));}
:is(.academy-panel,.petals-output):has(> iframe.expanded)::after {content:"";display:block;height:var(--page-height);}

body[data-system="petals"] #petals-panel {display:grid;grid-template-columns:subgrid;gap:16px;align-items:start;}
.workspace[data-expanded] #petals-input {display:none;}
.workspace[data-expanded] #petals-panel .petals-output {grid-column:1/-1;}
.petals-output {min-width:0;grid-column:1/-1;}
@media(max-width:767px){.workspace {grid-template-columns:minmax(0,1fr);}}
@media(min-width:768px){.petals-output {grid-column:2/-1;}}
#petals-input,.workspace .system-form {
  box-sizing:border-box;min-height:var(--input-panel-height);
  padding:12px;border-radius:12px;
}
/* в панели 64 кала́ один список — она не растягивается на высоту формы Джйотиш */
#petals-input {min-height:0;}
@media(min-width:1180px) {
  .workspace:not(.assistant-hidden) > .academy-panel {grid-column:1/-2;}
  .workspace > #assistant-panel {grid-column:-2/-1;grid-row:1;}
}
@media(max-width:1179px) {
  /* планшет и телефон: чат ИИ идёт ниже результатов, кнопка возврата — строкой под ним */
  .assistant-panel:not(.wide) {grid-column:1/-1;min-height:0;}
  #restore-assistant {position:static;grid-column:1/-1;justify-self:stretch;width:auto;height:32px;min-height:32px;flex-direction:row;gap:6px;padding:6px 12px;border-radius:12px 12px 0 0;font-size:11px;}
}
/* узкая колонка результата: таблицы не рвут слова, а прокручиваются */
@media(max-width:1023px) {
  .central-tables {overflow-x:auto;}
  #jyotish-chart-panel .central-table {min-width:520px;}
}
@media(max-width:767px) { .workspace .system-form {min-height:0;} }
body[data-system="numerology"] #numerology-result-panel:has(> #numerology-rashi[hidden]):has(> #numerology-result:empty) {display:none;}
