/* Homemade Luna: a small XP-style stylesheet using the same class names as XP.css / 98.css.
   Colors come from the theme variables in site.css (data-theme="blue|olive|silver"). */

body { font: 12px var(--font-ui); color: #000; }

/* ---------- windows ---------- */
.window {
  background: var(--frame);
  padding: 0 3px 3px;
  border-radius: 8px 8px 0 0;
  box-shadow: inset 1px 0 var(--frame-light), inset -1px -1px var(--frame-dark), 2px 4px 14px rgba(0, 0, 0, .35);
}
.title-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 30px; margin: 0 -3px; padding: 0 5px 0 7px;
  border-radius: 8px 8px 0 0;
  background: var(--title-grad);
  box-shadow: inset 0 1px rgba(255, 255, 255, .45);
}
.title-bar-text {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  color: var(--title-fg); font: bold 13px var(--font-title); letter-spacing: .2px;
  text-shadow: 1px 1px var(--title-shadow);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.title-bar-controls { display: flex; gap: 2px; flex: none; }
.title-bar-controls button {
  position: relative; width: 21px; height: 21px; min-width: 0; min-height: 0; padding: 0;
  border: 1px solid var(--ctl-border); border-radius: 3px;
  background: var(--ctl-bg); box-shadow: none;
}
.title-bar-controls button::before {
  content: ""; position: absolute; inset: 0; background: var(--ctl-glyph);
  -webkit-mask: var(--glyph) center / 13px 13px no-repeat; mask: var(--glyph) center / 13px 13px no-repeat;
}
.title-bar-controls button:hover { filter: brightness(1.15); box-shadow: none; }
.title-bar-controls button:active { filter: brightness(.9); }
.title-bar-controls button[aria-label=Minimize] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'><rect x='2' y='9' width='6' height='3'/></svg>"); }
.title-bar-controls button[aria-label=Maximize] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'><path d='M1.75 1.75h9.5v9.5h-9.5z' fill='none' stroke='black' stroke-width='1.5'/><rect x='1' y='1' width='11' height='3'/></svg>"); }
.title-bar-controls button[aria-label=Close] {
  background: var(--close-bg); --ctl-glyph: #fff;
  --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'><path d='M3 3l7 7M10 3l-7 7' stroke='black' stroke-width='2.2' stroke-linecap='round'/></svg>");
}
.window-body { background: var(--face); margin: 0; padding: 8px; }

/* ---------- status bar ---------- */
.status-bar { display: flex; gap: 2px; margin: 0; padding: 2px 3px; background: var(--face); border-top: 1px solid #d0d0bf; }
.status-bar-field { flex: 1; margin: 0; padding: 2px 6px; box-shadow: inset 1px 1px #a0a0a0, inset -1px -1px #fff; }

/* ---------- buttons ---------- */
button {
  font: 12px var(--font-ui); color: #000; cursor: pointer;
  min-width: 75px; min-height: 23px; padding: 0 12px;
  border: 1px solid #003c74; border-radius: 3px;
  background: linear-gradient(180deg, #fff, #ecebe6 86%, #d6d0c5);
}
button:hover { box-shadow: inset -1px 1px #fff0cf, inset 1px 2px #fdd889, inset -2px 2px #fbc761, inset 2px -2px #e5a01a; }
button:focus-visible {
  outline: 1px dotted #000; outline-offset: -4px;
  box-shadow: inset -1px 1px #cee7ff, inset 1px 2px #98b8ea, inset -2px 2px #bcd4f6, inset 1px -1px #89ade4, inset 2px -2px #89ade4;
}
button:active { background: linear-gradient(180deg, #cdcac3, #e3e3db 8%, #e5e5de 94%, #f2f2f1); box-shadow: none; }

/* ---------- fields ---------- */
input[type=text], input[type=url], textarea, select {
  font: 12px var(--font-ui); box-sizing: border-box;
  border: 1px solid var(--field-border); border-radius: 0; background: #fff; padding: 3px 4px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
select {
  appearance: none; padding-right: 22px;
  background: #fff url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 19'><rect x='.5' y='.5' width='16' height='18' rx='2' fill='%23c1d3fb' stroke='%23b9cdf8'/><path d='M5 8l3.5 3.5L12 8' fill='none' stroke='%234d6185' stroke-width='2'/></svg>") right 1px center / 17px 19px no-repeat;
}
input[type=checkbox], input[type=radio] {
  appearance: none; width: 13px; height: 13px; margin: 0 4px 0 0; vertical-align: -2px;
  border: 1px solid #1c5180; background: linear-gradient(135deg, #dcdcd7, #fff);
}
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:hover, input[type=radio]:hover { box-shadow: inset -1px -1px #f8b636, inset 1px 1px #fedf9c; }
input[type=checkbox]:checked {
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'><path d='M2 5l2.5 2.5L9 3' fill='none' stroke='%2321a121' stroke-width='2'/></svg>") center / 11px no-repeat, linear-gradient(135deg, #dcdcd7, #fff);
}
input[type=radio]:checked { background: radial-gradient(circle, #55d551 0 1.5px, #1b8c19 2.5px, transparent 3.5px), linear-gradient(135deg, #dcdcd7, #fff); }

fieldset { margin: 0 0 10px; padding: 8px 10px 10px; border: 1px solid #d0d0bf; border-radius: 4px; }
legend { color: var(--legend); padding: 0 3px; }
.field-row { display: flex; align-items: center; gap: 6px; }
.field-row + .field-row, .field-row-stacked + .field-row, .field-row-stacked + .field-row-stacked { margin-top: 6px; }
.field-row-stacked { display: flex; flex-direction: column; gap: 3px; }

/* ---------- tabs ---------- */
menu[role=tablist] { display: flex; flex-wrap: wrap; margin: 0; padding: 0 0 0 3px; position: relative; z-index: 1; }
menu[role=tablist] button {
  min-width: 0; min-height: 0; margin: 2px -1px 0 0; padding: 3px 10px 2px;
  border: 1px solid #919b9c; border-bottom: 0; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #fff, #fafaf9 26%, #f0f0ea 95%, #ecebe5);
}
menu[role=tablist] button:hover { box-shadow: inset 0 2px #ffc83c; }
menu[role=tablist] button[aria-selected=true] {
  position: relative; z-index: 2; margin-top: 0; margin-bottom: -1px; padding-bottom: 5px;
  background: #fcfcfe; box-shadow: inset 0 2px #ffc83c;
}
[role=tabpanel] { padding: 12px; border: 1px solid #919b9c; background: linear-gradient(180deg, #fcfcfe, #f4f3ee); box-shadow: 1px 1px #d0d0bf; }

/* ---------- tree view ---------- */
ul.tree-view { margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--field-border); }
ul.tree-view ul { margin: 0 0 0 7px; padding-left: 12px; list-style: none; border-left: 1px dotted #808080; }
ul.tree-view ul li { position: relative; }
ul.tree-view ul li::before { content: ""; position: absolute; left: -12px; top: 8px; width: 9px; border-top: 1px dotted #808080; }
ul.tree-view li { line-height: 17px; }
ul.tree-view a { color: #000; text-decoration: none; padding: 0 2px; }
ul.tree-view a:hover { color: var(--accent); text-decoration: underline; }
ul.tree-view a[aria-current] { background: #316ac5; color: #fff; }
ul.tree-view summary { list-style: none; cursor: pointer; }
ul.tree-view summary::-webkit-details-marker { display: none; }
ul.tree-view summary::before {
  content: "+"; display: inline-block; width: 9px; height: 9px; margin-right: 4px;
  font: 9px/8px monospace; text-align: center; color: #000;
  border: 1px solid #919b9c; background: linear-gradient(135deg, #fff, #d6d2c2);
}
ul.tree-view details[open] > summary::before { content: "\2212"; }

/* ---------- progress ---------- */
progress { appearance: none; width: 100%; height: 14px; padding: 1px; box-sizing: border-box; border: 1px solid #686868; border-radius: 3px; background: #fff; }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value {
  background: repeating-linear-gradient(90deg, transparent 0 8px, #fff 8px 10px),
    linear-gradient(180deg, #acedad, #7be47d 14%, #4cda50 28%, #2ed330 42%, #42d845 57%, #76e275 71%, #8fe791 85%, #fff);
}
progress::-moz-progress-bar {
  background: repeating-linear-gradient(90deg, transparent 0 8px, #fff 8px 10px),
    linear-gradient(180deg, #acedad, #7be47d 14%, #4cda50 28%, #2ed330 42%, #42d845 57%, #76e275 71%, #8fe791 85%, #fff);
}
