:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #253b34;
  background: #f5f5ef;
  font-synthesis: none;
  font-weight: 400;
  --green: #193c35;
  --muted: #77827a;
  --border: #dedfd5;
  --accent: #d3ed84;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  padding: 10px 15px;
  color: var(--green);
  transition: background 0.15s;
}
button:hover {
  background: #eef1e6;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #9abf51;
  outline-offset: 3px;
}
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px;
  background: #fafbf7;
  color: #263d34;
  min-width: 0;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -1.2px;
  margin-bottom: 10px;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
}
p {
  line-height: 1.6;
}
small {
  display: block;
}
.topbar {
  height: 108px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(32px, calc((100vw - 1120px) / 2));
  gap: 20px;
}
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.9px;
}
.brand small {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2px;
  color: var(--muted);
  margin-top: 3px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 13px;
  color: var(--accent);
  background: var(--green);
  font-size: 36px;
  line-height: 1;
  font-weight: 500;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 25px;
}
.connection {
  font-size: 12px;
  color: #5a7464;
  display: flex;
  align-items: center;
  gap: 7px;
}
.connection:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5d8b46;
}
.settings-button {
  background: transparent;
  font-size: 13px;
}
.workspace {
  max-width: 1120px;
  margin: 0 auto;
  padding: 38px 0 64px;
}
.section-label,
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 650;
  color: #8a9489;
}
.command-section {
  margin-bottom: 26px;
}
.section-label {
  margin-bottom: 12px;
}
.command-form {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #cdd2c4;
  border-radius: 14px;
  padding: 9px 10px 9px 20px;
  box-shadow: 0 5px 20px #243e3004;
}
.command-icon {
  font-size: 25px;
  color: #768674;
  margin-right: 13px;
}
.command-form input {
  border: 0;
  background: transparent;
  font-size: 16px;
  padding: 11px 0;
  outline: none;
}
.command-form input:focus-visible {
  outline: none;
}
.command-form:focus-within {
  border-color: #7c9c59;
  box-shadow: 0 0 0 3px #c8df9b55;
}
.command-form button {
  white-space: nowrap;
  background: #eef2e5;
  border: 0;
  padding: 12px 18px;
  font-size: 13px;
}
.command-result:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 16px;
  background: #e8efdb;
  border-radius: 9px;
}
.tool-launcher {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 43px;
}
.tool-card {
  position: relative;
  display: block;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 11px;
  text-decoration: none;
  background: #f9faf5;
  transition: background 0.15s;
}
.tool-card:hover {
  background: #edf2e1;
}
.tool-card.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.tool-number {
  font-size: 10px;
  color: #94a28f;
  font-family: monospace;
  display: block;
  margin-bottom: 16px;
}
.tool-card.active .tool-number {
  color: var(--accent);
}
.tool-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
  font-weight: 550;
}
.tool-card small {
  font-size: 11px;
  color: #8e998a;
  text-transform: capitalize;
}
.tool-card.active small {
  color: #aabfb2;
}
.tool-arrow {
  position: absolute;
  right: 15px;
  top: 15px;
  color: #96a38c;
}
.tool-card.active .tool-arrow {
  color: var(--accent);
}
.tool-heading {
  margin-bottom: 26px;
}
.tool-heading .eyebrow {
  margin-bottom: 12px;
}
.tool-heading p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 0;
}
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 27px;
  box-shadow: 0 4px 16px #253b3403;
}
.field {
  display: block;
  margin-bottom: 18px;
  font-size: 12px;
  color: #687a6c;
}
.field > span {
  display: block;
  margin-bottom: 8px;
}
.calculator input {
  font-size: 22px;
  text-align: right;
  border: 0;
  padding: 12px 0;
}
.calculator .field {
  border-bottom: 1px solid #edf0e6;
  margin-bottom: 5px;
}
.result-box {
  display: block;
  padding: 22px 18px;
  background: #f2f5e9;
  border-radius: 10px;
  font-size: 23px;
  overflow-wrap: anywhere;
  color: var(--green);
  margin: 18px 0;
  line-height: 1.5;
}
.result-box:empty {
  display: none;
}
.result-box span {
  display: block;
  font-size: 13px;
  margin-top: 8px;
  color: #75826c;
}
.calculator .result-box {
  font-size: 42px;
  text-align: right;
  background: transparent;
  padding: 5px 0;
  margin: 0 0 20px;
}
.calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.key {
  background: #f5f6ef;
  border: 0;
  font-size: 20px;
  height: 56px;
}
.key:hover {
  background: #e7ecdc;
}
.key.operator {
  background: #e5edd9;
}
.key.equals {
  background: var(--green);
  color: #fff;
}
.function-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 13px;
}
.function-keys button {
  border: 0;
  font-size: 12px;
  background: transparent;
  padding: 8px;
  color: #78866f;
}
.subtle {
  font-size: 12px;
  background: transparent;
  margin-top: 12px;
}
.muted,
.hint {
  color: var(--muted);
  font-size: 12px;
}
.hint {
  border-top: 1px solid #ebeee3;
  margin-top: 25px;
  padding-top: 18px;
  line-height: 1.8;
}
.history-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #eef0e7;
  padding: 15px 0;
  color: #637158;
  font-size: 13px;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #2c5548;
}
.conversion-row {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 10px;
  align-items: center;
}
.swap {
  padding: 8px;
  border: 0;
  background: #eff3e6;
  align-self: center;
  margin-top: 8px;
  font-size: 20px;
}
.chip {
  font-size: 12px;
  padding: 8px;
  margin: 0 6px 18px 0;
  background: #edf3e0;
  border: 0;
}
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.clock-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  background: #e9efd9;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 22px;
}
.clock-strip > span {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #748364;
}
.live-clock {
  font-size: 28px;
  font-family: ui-monospace, monospace;
  font-weight: 400;
}
.clock-strip button {
  margin: 0 0 0 auto;
}
.drop-zone {
  border: 1px dashed #b8c5a6;
  background: #f8faf3;
  border-radius: 12px;
  text-align: center;
  padding: 35px 20px;
}
.drop-zone.dragging {
  background: #e4edcf;
}
.drop-icon {
  font-size: 32px;
  color: #82965e;
  margin-bottom: 12px;
}
.drop-zone h2 {
  font-size: 19px;
  margin-bottom: 8px;
}
.drop-zone p {
  font-size: 13px;
  color: var(--muted);
}
.drop-zone input {
  max-width: 360px;
  font-size: 12px;
  background: transparent;
}
.file-list {
  padding: 0;
  list-style: none;
}
.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 0;
  border-bottom: 1px solid #eef0e6;
}
.file-index {
  font:
    12px ui-monospace,
    monospace;
  color: #9ca790;
  margin-right: 6px;
}
.file-name {
  flex: 1;
  font-size: 13px;
  overflow-wrap: anywhere;
  min-width: 0;
}
.file-name small {
  font-size: 10px;
  color: #9ba391;
  margin-top: 4px;
}
.file-list button {
  padding: 5px 10px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.actions .subtle {
  margin: 0;
}
progress {
  width: 100%;
  height: 6px;
  margin: 20px 0 8px;
  accent-color: #5e8655;
}
.download {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 9px;
  background: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
.settings-host {
  padding: 25px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 28px;
}
.settings-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.settings-title button {
  margin: 0;
}
.package-row {
  display: grid;
  grid-template-columns: 1fr 115px auto auto;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.package-row strong {
  font-size: 14px;
}
.package-row small {
  font-size: 11px;
  margin-top: 5px;
  color: var(--muted);
}
.package-row .field {
  margin: 0;
}
.package-row button {
  font-size: 11px;
  padding: 10px;
}
.settings-bottom {
  margin-top: 25px;
  font-size: 13px;
}
.notice:not(:empty) {
  padding: 12px 16px;
  background: #e9efd9;
  border-radius: 9px;
  margin-bottom: 20px;
  font-size: 13px;
}
.update-banner {
  padding: 16px;
  margin-bottom: 22px;
  border: 1px solid #a8c378;
  border-radius: 10px;
}
.update-banner button {
  margin-left: 12px;
}
.error {
  color: #a34939 !important;
}
.error-panel button {
  margin-right: 8px;
}
.text-button {
  padding: 4px 9px;
  font-size: 11px;
  background: transparent;
  border-color: #b8cb9b;
}
.suggestion {
  background: transparent;
  border-color: #bdcda6;
  font-size: 13px;
}
.boot {
  padding: 40px;
}
.error-panel h1 {
  font-size: 24px;
}
footer {
  max-width: 1120px;
  border-top: 1px solid var(--border);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 23px 0 30px;
  font-size: 11px;
  color: #96a08e;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1200px) {
  .workspace,
  footer {
    margin-left: 28px;
    margin-right: 28px;
  }
  .topbar {
    padding: 0 28px;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: 82px;
    padding: 0 18px;
  }
  .connection {
    display: none;
  }
  .workspace {
    padding-top: 25px;
    margin: 0 16px;
  }
  .topbar-right {
    gap: 10px;
  }
  .brand {
    font-size: 23px;
  }
  .tool-launcher {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 30px;
  }
  .tool-card {
    padding: 13px;
  }
  .tool-number {
    margin-bottom: 9px;
  }
  .tool-grid,
  .two-columns {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 20px;
  }
  .command-form {
    padding-left: 12px;
  }
  .command-form input {
    font-size: 13px;
  }
  .command-form button {
    padding: 10px;
    font-size: 11px;
  }
  .command-icon {
    font-size: 20px;
  }
  .clock-strip {
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px;
  }
  .clock-strip > span {
    width: 100%;
  }
  .clock-strip button {
    margin-left: 0;
  }
  .package-row {
    grid-template-columns: 1fr 100px;
  }
  .package-row button {
    width: 100%;
  }
  h1 {
    font-size: 29px;
  }
  footer {
    margin: 0 16px;
    gap: 18px;
    line-height: 1.6;
  }
  .file-list li {
    gap: 5px;
  }
  .file-list button {
    padding: 5px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Local image upscaler */
.local-badge{color:#326052;font-weight:600}.upscaler-source{display:block;max-width:100%;max-height:220px;margin:1.5rem auto;object-fit:contain}.upscaler-source[hidden]{display:none}.upscaler-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem;margin:1.5rem 0}.upscaler select{width:100%;padding:.65rem;border:1px solid #ccc;border-radius:8px;background:transparent;color:inherit}.upscaler input[type=range]{width:100%;accent-color:#428571}.upscaler-advanced{margin:1rem 0;padding:1rem;border:1px solid #ddd;border-radius:10px}.upscaler-advanced summary{cursor:pointer;font-weight:600;margin-bottom:1rem}.upscaler-diagnostics{white-space:pre-wrap;overflow-wrap:anywhere;max-height:300px;overflow:auto;font-size:.75rem}.upscaler progress{width:100%;height:8px}.compare-frame{position:relative;border:1px solid #b9bfc0;border-radius:8px;overflow:hidden}.compare-viewport{overflow:auto;max-height:70vh;position:relative;touch-action:pan-x pan-y}.compare-layers{position:relative;background-color:#fff;background-image:linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0}.compare-layers img{display:block;width:100%;height:100%;max-width:none;user-select:none}.compare-original{position:absolute;inset:0;background:inherit}.compare-divider{position:absolute;top:0;bottom:0;width:3px;background:#fff;box-shadow:0 0 3px #000;cursor:ew-resize;touch-action:none;z-index:2}.compare-divider span{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);padding:12px 8px;border-radius:20px;background:#fff;color:#222;box-shadow:0 1px 8px #555}.compare-labels{display:flex;justify-content:space-between;font-size:.85rem;margin:1rem 0 .5rem}.comparison{margin-top:1.5rem}.comparison>input{display:block;margin:1rem 0}.upscaler [hidden]{display:none!important}
