/* Package "shell": extra styles for the shell (main window, cockpit, chart, ticker, start/end screens).
   Base look and reusable classes live in sap.css (owned by core). Prefix new classes with .sh- */

/* ---------- main window pieces ---------- */
.sh-burger { display: none; padding: 1px 8px; font-size: 16px; line-height: 1; }
.sh-sysbtns { display: inline-flex; gap: 4px; }
.sh-pausebtn.is-on { background: linear-gradient(#fff3b0, #ffd84a); border-color: var(--sap-warn); }
.sh-band { font: inherit; color: inherit; cursor: pointer; border-radius: 0; min-height: var(--sap-touch); }
.sh-band:hover { background: var(--sap-focus); }
.sh-clock { min-width: 82px; text-align: center; }
.sh-clock.sh-blink { color: #fff; background: #a3160b; animation: sh-blink 1s steps(2, start) infinite; }
@keyframes sh-blink { to { background: #102a52; color: #ffd75e; } }
.sh-workwrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; min-width: 0; }
.sh-workwrap > .sap-work { flex: 1; min-height: 0; }
.sap-window.is-paused .sap-work { filter: grayscale(.8) brightness(.93); }
/* pause bar: a row in the flow above the work area, never on top of the content */
.sh-maint {
	flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 4px 12px;
	background: #fff6c8; border-bottom: 1px solid var(--sap-warn); font-weight: 700;
}
.sh-maint__icon { font-size: 18px; }
.sh-appbar .sh-tb { flex: none; }
.sh-status__icon { display: inline-flex; width: 16px; justify-content: center; flex: none; }
.sh-status__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sap-status__msg { text-align: left; }
.sh-busy { pointer-events: none; }

/* ---------- menus ---------- */
.sh-menubar { position: relative; z-index: 30; }
.sh-menu__item { display: flex; align-items: center; gap: 18px; width: 100%; }
.sh-menu__label { flex: 1; }
.sh-menu__hint { color: var(--sap-muted); font-size: 11px; }
.sh-menu__arrow { font-size: 9px; }
.sap-menu__item:hover .sh-menu__hint, .sap-menu__item:focus-visible .sh-menu__hint { color: #dbe6ff; }
.sap-menu__item.is-locked { opacity: .6; }
.sap-menu__item[aria-disabled='true'] { color: var(--sap-muted); cursor: default; }
.sap-menu__item[aria-disabled='true']:hover { background: none; color: var(--sap-muted); }
.sh-menu-sub { position: relative; }
.sh-menu-sub > .sh-submenu { left: 100%; top: -3px; min-width: 260px; }
.sap-menu__panel { min-width: 230px; }
.sap-menu__item:focus { outline: none; }
.sap-menu__item:focus-visible { background: var(--sap-title-a); color: #fff; outline: none; }

/* ---------- ticker ---------- */
.sh-ticker { border-top: 1px solid #000; }
.sh-ticker .sap-ticker__track { animation: none; padding-left: 0; display: inline-flex; will-change: transform; }
.sh-ticker .sap-ticker__item { flex: none; }
.sh-ticker--final { font-size: 15px; padding: 6px 0; background: #3a0b0b; color: #fff; border-bottom: 2px solid #ffd75e; }
.sh-ticker--final .sap-ticker__item { font-weight: 700; }

/* ---------- cockpit ---------- */
.sh-tiles { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.sh-tile--warn { border-top-color: var(--sap-warn-bg); background: #fffbe6; }
.sh-tile--crit { border-top-color: var(--sap-err); background: #fff0ee; }
.sh-lage { margin: 0 0 8px; color: var(--sap-muted); }
.sh-alerts:empty { display: none; }
.sh-alert { display: flex; align-items: center; gap: 8px; padding: 4px 8px; margin: 0 0 6px; background: #fff6c8; border: 1px solid var(--sap-warn); }
.sh-alert.is-E { background: #fff0ee; border-color: var(--sap-err); }
.sh-alert__text { flex: 1; min-width: 0; font-weight: 700; }
.sh-alert .sap-btn { flex: none; }
.sh-meters { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.sh-mtr {
	display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; min-width: 0; min-height: var(--sap-touch);
	padding: 1px 6px; background: #fff; border: 1px solid var(--sap-frame); cursor: pointer; text-align: left; font-variant-numeric: tabular-nums;
}
.sh-mtr:hover { background: var(--sap-focus); }
.sh-mtr__lbl { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sh-mtr__bar { height: 6px; min-width: 16px; background: #dde3ec; border: 1px solid #b4bfcd; }
.sh-mtr__fill { display: block; height: 100%; width: 0; background: var(--sap-ok); }
.sh-mtr.is-warn .sh-mtr__fill { background: var(--sap-warn-bg); }
.sh-mtr.is-crit { border-color: var(--sap-err); }
.sh-mtr.is-crit .sh-mtr__fill { background: var(--sap-err); }
.sh-mtr__val { font-size: 11px; font-weight: 700; }
.sh-mtr.is-locked { opacity: .55; }
.sh-kkx { margin: 6px 0 0; }
.sh-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.sap-alv tr.is-selected-soft td { background: #fff2bf !important; }

/* ---------- chart ---------- */
.sh-chart { padding: 0; }
.sh-chart canvas { touch-action: pan-y; }
.sh-chart__readout { min-height: 16px; padding: 0 8px; font-size: 11px; color: var(--sap-muted); }
.sh-chart__legend { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 4px 8px 8px; }
.sh-chart__leg { display: inline-flex; align-items: center; gap: 6px; min-height: var(--sap-touch); padding: 1px 8px; background: var(--sap-panel); border: 1px solid var(--sap-frame); cursor: pointer; font-variant-numeric: tabular-nums; }
.sh-chart__leg.is-off { opacity: .45; text-decoration: line-through; }
.sh-chart__swatch { display: inline-block; width: 22px; height: 0; border-top-width: 3px; }
.sh-chart__val { color: var(--sap-muted); }

/* ---------- Easy Access tree ---------- */
.sh-tree { padding: 4px 0; }
.sh-tree ul { padding-left: 20px; }
.sh-tree .sap-tree__node::before { content: none; }
.sh-tree__root { padding: 2px 4px 4px; }
.sh-tree__node { width: 100%; max-width: 100%; }
.sh-tree__title { min-width: 0; overflow-wrap: anywhere; }
.sh-tree__count { color: var(--sap-muted); }
.sh-tree__node.is-locked { opacity: .6; }
.sh-tree__node[tabindex='0'] { background: var(--sap-sel); border-color: var(--sap-frame); }
.sh-detail { min-width: 0; }

/* ---------- login, help, end ---------- */
.sh-login { max-width: 640px; }
.sh-login__head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.sh-login__mark { font-size: 44px; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--sap-title-a), var(--sap-title-b)); border: 1px solid var(--sap-frame-dk); flex: none; }
.sh-login__sub { margin: 0; color: var(--sap-muted); }
.sh-login__buttons { margin: 8px 0 12px; }
.sh-rules dt { font-weight: 700; color: var(--sap-title-a); }
.sh-rules dd { font-weight: 400; }
.sh-list { margin: 0; padding-left: 18px; }
.sh-list li { margin: 2px 0; }
.sh-keys dd, .sh-keys dt { font-weight: 400; }
kbd { font-family: var(--sap-mono); font-size: 11px; padding: 0 4px; background: var(--sap-panel); border: 1px solid var(--sap-frame); border-radius: 2px; }
.sh-banner { display: flex; align-items: center; gap: 14px; padding: 10px 14px; margin: 0 0 10px; border: 1px solid var(--sap-frame-dk); background: #fff; border-left: 8px solid var(--sap-info); }
.sh-banner.is-win { border-left-color: var(--sap-ok); background: #eaf7ec; }
.sh-banner.is-lose { border-left-color: var(--sap-err); background: #fdeeee; }
.sh-banner__bell { font-size: 40px; transform-origin: 50% 0; animation: sh-swing 1.6s ease-in-out 3; }
.sh-banner__title { font-size: 16px; font-weight: 700; }
.sh-banner__sub { color: var(--sap-muted); }
@keyframes sh-swing { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(18deg); } 75% { transform: rotate(-18deg); } }
.sh-endcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.sh-honors { list-style: none; margin: 0; padding: 0; }
.sh-honors li { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px solid #d2dae5; }
.sh-honors__icon { font-size: 18px; }
.sh-qgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 0 10px; }
.sh-save { display: flex; align-items: center; gap: 12px; }
.sh-save__disk { font-size: 36px; animation: sh-pop .4s ease-out; }
@keyframes sh-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.sh-msglog li { display: flex; gap: 4px; align-items: baseline; }

@media (prefers-reduced-motion: reduce) {
	.sh-clock.sh-blink, .sh-banner__bell, .sh-save__disk { animation: none; }
}

/* ---------- phones ---------- */
@media (max-width: 720px) {
	.sh-burger { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; }
	/* the menu unfolds below the system bar, so the burger button stays where it was tapped */
	.sap-window > .sap-titlebar { order: -2; }
	.sap-window > .sap-systembar { order: -1; }
	.sh-menubar.is-open { border-bottom: 2px solid var(--sap-frame-dk); }
	.sh-menubar { display: none; flex-direction: column; flex-wrap: nowrap; max-height: 60vh; overflow-y: auto; }
	.sh-menubar.is-open { display: flex; }
	.sh-menubar .sap-menu__btn { width: 100%; text-align: left; font-weight: 700; }
	.sh-menubar .sap-menu__panel { position: static; box-shadow: none; border: 0; border-left: 3px solid var(--sap-frame); margin: 0 0 4px 8px; }
	.sh-menubar .sh-menu-sub > .sh-submenu { position: static; min-width: 0; margin-left: 12px; }
	.sh-menu__item { white-space: normal; }
	.sh-menu__hint { display: none; }
	.sap-systembar { gap: 3px; padding: 3px 4px; }
	.sap-systembar .sap-btn { min-width: 36px; padding: 1px 5px; justify-content: center; }
	.sh-clock { min-width: 0; }
	.sh-appbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
	.sh-appbar .sap-key { display: none; }
	.sh-maint { font-size: 11px; gap: 6px; padding: 2px 8px; justify-content: space-between; }
	.sh-maint__text { min-width: 0; }
	.sh-ticker { font-size: 11px; }
	.sh-ticker--final { font-size: 13px; padding: 4px 0; }
	.sh-endcols { grid-template-columns: 1fr; }
	.sh-banner { padding: 8px 10px; }
	.sh-banner__bell { font-size: 30px; }
	.sh-banner__title { font-size: 14px; }
	.sh-login__mark { width: 52px; height: 52px; font-size: 30px; }
	.sap-login { margin: 8px auto; }
	.sh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sh-meters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.sh-alert { flex-wrap: wrap; }
	.sh-alert__text { flex-basis: calc(100% - 30px); font-size: 12px; }
	.sh-chart__leg { padding: 1px 6px; }
	.sh-menu-sub > .sap-menu__item::after { content: none; }
	.sap-popup__body { padding: 10px; }
}

.sap-alv td.is-right { white-space: nowrap; }
