/* Shared geometry for the six optional appearances. Classic is deliberately excluded.
 * Material and palette belong to appearance-polish.css / appearance-liquid.css.
 * Keep the established content width, information order and table-cell density. */
html[data-appearance]:not([data-appearance="classic"])[data-theme] {
  --ui-control-radius:10px;
  --ui-segment-radius:14px;
  --ui-card-radius:16px;
  --ui-dialog-radius:20px;
  --radius-sm:var(--ui-control-radius);
  --radius:var(--ui-card-radius);
  --radius-lg:var(--ui-dialog-radius);
}

/* One navigation plane, with a single raised selection rather than nested rims. */
html[data-appearance]:not([data-appearance="classic"])[data-theme] .header-inner { max-width:1280px; gap:10px; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] #tabNav {
  min-width:0; padding:4px; gap:4px; border:0;
  border-radius:var(--ui-segment-radius);
  background:transparent!important; box-shadow:none;
}
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.btn,.tab-btn,.asset-sub-btn,.subscription-sub-btn,.income-sub-btn,.skill-sub-btn,.session-button,.subscription-filter-btn) {
  box-sizing:border-box; border-radius:var(--ui-control-radius);
  font-family:inherit; line-height:18px; letter-spacing:0;
}
html[data-appearance]:not([data-appearance="classic"])[data-theme] .btn { min-height:36px; padding:8px 14px; font-size:13px; justify-content:center; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .btn.btn-sm { min-height:28px; padding:4px 10px; font-size:11px; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .header :is(.tab-btn,.hub-search-trigger,.session-badge) {
  box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center;
  height:36px; min-height:36px; padding:8px 12px; border-radius:var(--ui-control-radius);
  font-family:inherit; font-size:13px; line-height:18px; white-space:nowrap;
}
html[data-appearance]:not([data-appearance="classic"])[data-theme] #tabNav .tab-btn { min-width:0; padding:8px 6px; font-size:13px; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .header :is(.header-settings,.hub-search-trigger) { min-width:52px; flex-shrink:0; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .session-slot { min-width:0; flex-shrink:0; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .session-badge { border-radius:var(--ui-control-radius); }
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.tab-btn,.asset-sub-btn,.subscription-sub-btn,.income-sub-btn,.skill-sub-btn):hover { transform:none; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .tab-btn.active::after { content:none; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.asset-sub-nav,.subscription-sub-nav,.income-sub-nav,.skill-sub-nav,#overviewDisplayControl .ov-switch,.subscription-view-toggle,.product-view-switch,.appearance-modes) {
  box-sizing:border-box; border-radius:var(--ui-segment-radius); padding:3px; gap:4px;
  border-width:1px; border-style:solid;
}
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.asset-sub-btn,.subscription-sub-btn,.income-sub-btn,.skill-sub-btn) {
  min-height:36px; padding:8px 12px; font-size:13px; border:1px solid transparent;
}
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(#overviewDisplayControl .ov-switch,.subscription-view-toggle,.product-view-switch,.appearance-modes) > button {
  box-sizing:border-box; border-radius:var(--ui-control-radius); line-height:18px;
}
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(#overviewDisplayControl .ov-switch,.subscription-view-toggle,.product-view-switch) > button {
  min-height:28px; padding:4px 10px;
}
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.tab-page,.card,.metric-card,.stat-card,.income-card,.annual-total-card,.monthly-total-card,.index-card,.news-card,.predict-settings-card,.fixed-expense-right,.asset-hub-card,.subscription-card,.prepaid-card,.inventory-card,.product-card,.household-overview,.hub-panel,.screen-panel,.appearance-settings,.asset-hub-summary>div,.subscription-summary>div) {
  border-radius:var(--ui-card-radius);
}
/* Images clip against their own panel; do not clip cards, focus rings or menus. */
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.tab-page,.card,.metric-card,.stat-card,.income-card,.asset-hub-card)::before,
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.tab-page,.card,.metric-card,.stat-card,.income-card,.asset-hub-card)::after { border-radius:inherit; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.alert-banner,.subscription-list-row,.inventory-list-row,.record-list-row,.table-wrap,.record-table-wrap,.inventory-charge) { border-radius:var(--ui-control-radius); }
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.modal,.modal-content,.auth-panel,.stock-lock-panel,.photo-editor-dialog,.product-details-dialog) { border-radius:var(--ui-dialog-radius); }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .modal-header { border-radius:calc(var(--ui-dialog-radius) - 1px) calc(var(--ui-dialog-radius) - 1px) 0 0; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .modal-footer { border-radius:0 0 calc(var(--ui-dialog-radius) - 1px) calc(var(--ui-dialog-radius) - 1px); }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .modal-close { box-sizing:border-box; width:32px; height:32px; border-radius:var(--ui-control-radius); }
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.form-group,.auth-panel,.account-admin,.inventory-toolbar,.hub-search-form,.appearance-time-fields) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea) { border-radius:var(--ui-control-radius); }
/* Spreadsheet cells are deliberately not rounded or enlarged. */
html[data-appearance]:not([data-appearance="classic"])[data-theme] #overviewScreen .ov-panel { border-radius:var(--ui-card-radius); }
html[data-appearance]:not([data-appearance="classic"])[data-theme] #overviewScreen :is(.ov-icon-button,.ov-range button) { border-radius:var(--ui-control-radius); }
html[data-appearance]:not([data-appearance="classic"])[data-theme] #overviewScreen .ov-range { border-radius:var(--ui-segment-radius); padding:3px; gap:4px; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] .bulk-sheet.is-expanded { border-radius:0; }
html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(button,input,select,textarea):focus-visible { outline:2px solid var(--a-accent); outline-offset:2px; }

/* A two-row header prevents tablet widths from squeezing the five destinations. */
@media(max-width:1023px) {
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .header-inner {
    display:grid; height:auto; grid-template-columns:minmax(0,1fr) auto auto auto;
    grid-template-rows:44px 52px; padding:6px 12px; column-gap:6px; row-gap:4px; align-items:center;
  }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header-inner .logo { grid-column:1; grid-row:1; min-width:0; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header-inner .header-settings { grid-column:2; grid-row:1; align-self:center; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header-inner .hub-search-trigger { grid-column:3; grid-row:1; align-self:center; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header-inner .session-slot { grid-column:4; grid-row:1; align-self:center; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header #tabNav {
    display:grid; grid-template-columns:repeat(5,minmax(0,1fr));
    grid-column:1/-1; grid-row:2; width:100%; padding:4px; gap:4px; overflow:visible;
  }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header :is(.tab-btn,.hub-search-trigger,.session-badge) {
    height:44px; min-height:44px; padding:8px; font-size:12px;
  }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] #tabNav .tab-btn { height:44px; min-height:44px; padding:4px 2px; font-size:12px; line-height:16px; white-space:normal; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .session-button .session-name,
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .session-name + .session-exit::before { display:none; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header :is(.header-settings,.hub-search-trigger) { min-width:44px; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.asset-sub-btn,.subscription-sub-btn,.income-sub-btn,.skill-sub-btn) { min-height:44px; }
}
@media(max-width:767px) {
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .logo { font-size:14px; gap:6px; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .logo-mark { width:26px; height:26px; border-radius:8px; font-size:16px; flex-shrink:0; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .session-badge { font-size:11px; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(.modal-footer,.hub-shortcuts,.inventory-toolbar,.subscription-toolbar,.page-heading,.bulk-actions) .btn,
  html[data-appearance]:not([data-appearance="classic"])[data-theme] :is(#overviewDisplayControl .ov-switch,.subscription-view-toggle,.product-view-switch,.appearance-modes) > button { min-height:44px; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .modal-close { width:44px; height:44px; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .subscription-sub-nav { overflow-x:auto; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .subscription-sub-btn { flex:0 0 auto; }
}
@media(max-width:359px) {
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .header-inner { padding-inline:8px; column-gap:4px; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .logo { gap:4px; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .logo > span:last-child { font-size:11px; letter-spacing:0; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .logo-mark { width:24px; height:24px; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .session-badge { padding-inline:5px; font-size:11px; }
  html[data-appearance]:not([data-appearance="classic"])[data-theme] .header .session-exit { font-size:11px; }
}
