:root {
  color-scheme: light;
  --desktop: #008080;
  --page: #ffffcc;
  --panel: #ece9d8;
  --panel-deep: #d8d2bd;
  --title-a: #0a246a;
  --title-b: #3a6ea5;
  --title-text: #ffffff;
  --text: #000000;
  --link: #0000ee;
  --visited: #551a8b;
  --red: #cc0000;
  --green: #008000;
  --yellow: #ffff66;
  --shadow-dark: #808080;
  --shadow-darker: #404040;
  --highlight: #ffffff;
  --highlight-soft: #f7f3df;
  --border: #000000;
  --scrollbar-face: #c0c0c0;
  --scrollbar-track: #ece9d8;
  --scrollbar-edge-light: #ffffff;
  --scrollbar-edge-dark: #404040;
  --scrollbar-edge-mid: #808080;
  --font: "MS PGothic", "ＭＳ Ｐゴシック", "MS P Gothic", Osaka, "Hiragino Kaku Gothic ProN", sans-serif;
  --mono: "MS Gothic", "ＭＳ ゴシック", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

@supports (-moz-appearance: none) {
  * {
    scrollbar-color: var(--scrollbar-face) var(--scrollbar-track);
    scrollbar-width: auto;
  }
}

html,
body {
  min-height: 100%;
}

html,
body,
.chat-list {
  scrollbar-gutter: stable;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  height: 17px;
  width: 17px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background:
    linear-gradient(90deg, rgba(64, 64, 64, 0.12), transparent 2px, transparent calc(100% - 2px), rgba(255, 255, 255, 0.85)),
    repeating-linear-gradient(
      45deg,
      var(--scrollbar-track) 0,
      var(--scrollbar-track) 4px,
      #ece9d8 4px,
      #ece9d8 8px
    );
  border-color: var(--scrollbar-edge-dark) var(--scrollbar-edge-light) var(--scrollbar-edge-light) var(--scrollbar-edge-dark);
  border-style: solid;
  border-width: 1px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0 14%, transparent 14%),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(64, 64, 64, 0.18) 5px 6px),
    linear-gradient(180deg, #eeeeee 0, var(--scrollbar-face) 48%, #a0a0a0 100%);
  border-color: var(--scrollbar-edge-light) var(--scrollbar-edge-dark) var(--scrollbar-edge-dark) var(--scrollbar-edge-light);
  border-style: solid;
  border-width: 2px;
  box-shadow:
    inset -1px -1px 0 var(--scrollbar-edge-mid),
    inset 1px 1px 0 var(--scrollbar-edge-light);
  min-height: 34px;
  min-width: 34px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(135deg, #ffffff 0 14%, transparent 14%),
    linear-gradient(180deg, #fff8d8 0, #e2d78e 48%, #bfb46c 100%);
}

html::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active,
*::-webkit-scrollbar-thumb:active {
  border-color: var(--scrollbar-edge-dark) var(--scrollbar-edge-light) var(--scrollbar-edge-light) var(--scrollbar-edge-dark);
  box-shadow:
    inset 1px 1px 0 var(--scrollbar-edge-mid),
    inset -1px -1px 0 var(--scrollbar-edge-light);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner {
  background: var(--scrollbar-face);
  border: 1px solid var(--scrollbar-edge-dark);
}

html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button,
*::-webkit-scrollbar-button {
  background:
    linear-gradient(135deg, var(--scrollbar-edge-light) 0 48%, var(--scrollbar-face) 48% 100%);
  border-color: var(--scrollbar-edge-light) var(--scrollbar-edge-dark) var(--scrollbar-edge-dark) var(--scrollbar-edge-light);
  border-style: solid;
  border-width: 2px;
  height: 17px;
  width: 17px;
}

html::-webkit-scrollbar-button:vertical:decrement,
body::-webkit-scrollbar-button:vertical:decrement,
*::-webkit-scrollbar-button:vertical:decrement {
  background:
    linear-gradient(45deg, transparent 43%, #000080 43% 57%, transparent 57%) 50% 45% / 9px 7px no-repeat,
    linear-gradient(135deg, var(--scrollbar-edge-light) 0 48%, var(--scrollbar-face) 48% 100%);
}

html::-webkit-scrollbar-button:vertical:increment,
body::-webkit-scrollbar-button:vertical:increment,
*::-webkit-scrollbar-button:vertical:increment {
  background:
    linear-gradient(135deg, transparent 43%, #000080 43% 57%, transparent 57%) 50% 55% / 9px 7px no-repeat,
    linear-gradient(135deg, var(--scrollbar-edge-light) 0 48%, var(--scrollbar-face) 48% 100%);
}

html::-webkit-scrollbar-button:horizontal:decrement,
body::-webkit-scrollbar-button:horizontal:decrement,
*::-webkit-scrollbar-button:horizontal:decrement {
  background:
    linear-gradient(135deg, transparent 43%, #000080 43% 57%, transparent 57%) 44% 50% / 7px 9px no-repeat,
    linear-gradient(135deg, var(--scrollbar-edge-light) 0 48%, var(--scrollbar-face) 48% 100%);
}

html::-webkit-scrollbar-button:horizontal:increment,
body::-webkit-scrollbar-button:horizontal:increment,
*::-webkit-scrollbar-button:horizontal:increment {
  background:
    linear-gradient(45deg, transparent 43%, #000080 43% 57%, transparent 57%) 56% 50% / 7px 9px no-repeat,
    linear-gradient(135deg, var(--scrollbar-edge-light) 0 48%, var(--scrollbar-face) 48% 100%);
}

body {
  margin: 0;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.14) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.14) 75%) 0 0 / 16px 16px,
    var(--desktop);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select {
  touch-action: manipulation;
}

button {
  min-height: 28px;
}

body.registration-mode .app-shell,
body.registration-mode .photo-viewer {
  display: none;
}

html.public-auto-start body.registration-mode .registration-shell,
html.public-auto-start body.registration-mode .photo-viewer {
  display: none;
}

html.public-auto-start body.registration-mode .app-shell {
  display: block;
}

.registration-shell {
  margin: 12px auto;
  max-width: 860px;
  padding: 0 8px;
}

.registration-shell.hidden {
  display: none;
}

.registration-window {
  background: var(--page);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  min-height: calc(100vh - 24px);
  padding: 6px;
}

.job-alert {
  background: #000000;
  border: 1px solid #ffffff;
  color: #ffff66;
  font-family: var(--mono);
  font-size: 12px;
  margin: 6px 0;
  padding: 2px;
}

.registration-body {
  display: grid;
  gap: 6px;
  grid-template-columns: 210px minmax(0, 1fr);
}

.job-sidebar,
.job-main {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  min-width: 0;
  padding: 6px;
}

.job-counter {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #66ff66;
  display: grid;
  font-family: var(--mono);
  font-size: 12px;
  gap: 2px;
  margin-bottom: 6px;
  padding: 5px;
  text-align: center;
}

.job-counter strong {
  color: #ffff66;
  font-size: 16px;
  letter-spacing: 0;
}

.job-spec {
  display: grid;
  gap: 5px;
  margin: 0;
}

.job-spec div {
  background: #ffffee;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  padding: 4px 5px;
}

.job-spec dt {
  color: #800000;
  font-weight: 700;
  margin: 0 0 2px;
}

.job-spec dd {
  font-size: 12px;
  margin: 0;
}

.job-stamp {
  background: #ffff66;
  border: 2px solid #cc0000;
  color: #cc0000;
  font-weight: 700;
  margin: 8px 0 0;
  padding: 4px;
  text-align: center;
}

.job-main {
  background: #ffffee;
  display: grid;
  gap: 8px;
}

.job-eyebrow {
  background: #000080;
  color: #ffffff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 5px;
}

.job-main h1 {
  background: #ffff66;
  border: 2px solid #cc0000;
  color: #cc0000;
  font-size: 30px;
  line-height: 1.15;
  padding: 5px 7px;
  text-shadow: 1px 1px 0 #ffffff;
}

.job-copy {
  background: #ffffff;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  line-height: 1.5;
  padding: 6px;
}

.job-warnings {
  background: #fff4d8;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #600000;
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 6px 6px 6px 22px;
}

.registration-form {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  display: grid;
  gap: 7px;
  padding: 7px;
}

.registration-field {
  display: grid;
  gap: 3px;
}

.registration-field span {
  color: #800000;
  font-weight: 700;
}

.registration-field em,
.registration-field small {
  color: #cc0000;
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
}

.registration-field input,
.registration-field select {
  background: #ffffff;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #000000;
  min-height: 28px;
  min-width: 0;
  padding: 3px 5px;
  width: 100%;
}

.registration-check {
  align-items: start;
  background: #ffffcc;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 5px;
}

.registration-check input {
  margin-top: 3px;
}

.registration-error {
  color: #cc0000;
  font-family: var(--mono);
  font-size: 12px;
  min-height: 16px;
}

.registration-submit {
  background: #ffff66;
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  color: #000080;
  cursor: pointer;
  font-weight: 700;
  min-height: 34px;
  padding: 6px 10px;
}

.registration-submit:hover {
  background: #fff7c2;
  color: #800000;
}

.registration-submit:active {
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  padding: 7px 9px 5px 11px;
}

.app-shell {
  background: var(--page);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  margin: 12px auto;
  max-width: 980px;
  min-height: calc(100vh - 24px);
  padding: 6px;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  border-style: solid;
  border-width: 2px;
  display: none;
  gap: 6px;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  padding: 5px;
}

.topbar > * {
  min-width: 0;
}

.brand {
  align-items: center;
  display: flex;
  gap: 7px;
  min-width: 0;
}

.brand > div {
  min-width: 0;
}

.brand-mark {
  background:
    linear-gradient(90deg, #f7d77b 0 30%, #d59600 30% 42%, #fff2a0 42% 58%, #b36b00 58% 100%);
  border: 1px solid #7a4b00;
  display: block;
  height: 30px;
  width: 20px;
}

.eyebrow,
.brand-title,
.level-label,
h1,
h2,
h3,
p {
  margin: 0;
}

.eyebrow {
  color: #000080;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.brand-title {
  color: #800000;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 1px 1px 0 #ffffff;
}

.counter-box {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #66ff66;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0;
  padding: 3px 6px;
}

.topbar-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.topbar-readout span {
  background: #ffffff;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #000000;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  padding: 4px 6px;
  white-space: nowrap;
}

.marquee-strip {
  background: #000000;
  border: 1px solid #ffffff;
  color: #ffff66;
  font-family: var(--mono);
  font-size: 12px;
  margin: 6px 0;
  padding: 2px;
}

.text-button,
.action-button {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  color: #000000;
  cursor: pointer;
  padding: 4px 10px;
}

.text-button:hover,
.action-button:hover {
  background: #fff7c2;
  color: #000080;
}

.text-button:disabled:hover,
.action-button:disabled:hover {
  background: var(--panel);
  color: #808080;
}

.text-button:active,
.action-button:active {
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  padding: 5px 9px 3px 11px;
}

.text-button:disabled:active,
.action-button:disabled:active {
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  padding: 4px 10px;
}

.game-layout {
  display: grid;
  gap: 6px;
  grid-template-columns: 178px minmax(0, 1fr) 230px;
}

.status-panel,
.scene-panel,
.record-panel {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
}

.status-panel,
.record-panel {
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 5px;
}

.scene-panel {
  align-self: start;
  min-width: 0;
  overflow: hidden;
}

h1 {
  color: #000080;
  font-size: 22px;
  line-height: 1.25;
  text-shadow: 1px 1px 0 #ffffff;
}

h2 {
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--title-text);
  font-size: 13px;
  font-weight: 700;
  margin: -3px -3px 5px;
  padding: 3px 5px;
}

h3 {
  color: #800000;
  font-size: 13px;
  font-weight: 700;
}

.window-titlebar {
  align-items: center;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--title-text);
  display: flex;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  justify-content: space-between;
  padding: 3px 4px;
}

.window-buttons {
  display: flex;
  gap: 2px;
}

.window-buttons i {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 1px;
  display: block;
  height: 14px;
  width: 16px;
}

.scene-frame {
  aspect-ratio: 4 / 3;
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  margin: 5px;
  overflow: hidden;
  position: relative;
}

.shop-panel {
  background: #ffffcc;
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  box-shadow: none;
  color: #000000;
  display: grid;
  gap: 5px;
  max-height: none;
  overflow: visible;
  overflow-x: visible;
  overflow-y: visible;
  padding: 6px;
  position: static;
  width: auto;
}

.shop-panel.hidden {
  display: none;
}

.shop-panel h3 {
  background: linear-gradient(90deg, #800000, #cc6600);
  color: #ffffff;
  font-size: 13px;
  margin: -4px -4px 0;
  padding: 3px 5px;
}

.shop-wallet,
.shop-notice {
  font-family: var(--mono);
  font-size: 12px;
}

.shop-notice {
  color: #800000;
}

.shop-empty {
  color: #666666;
  font-size: 12px;
}

.shop-offers,
.shop-form {
  background: #ffffee;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  display: grid;
  gap: 4px;
  padding: 4px;
}

.shop-bottom-actions {
  display: grid;
  gap: 4px;
}

.shop-buy-button,
.shop-close-button,
.shop-form button,
.shop-form select,
.shop-form input {
  font: inherit;
  min-height: 24px;
}

.shop-buy-button,
.shop-close-button,
.shop-form button {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  color: #000080;
  cursor: pointer;
  padding: 3px 5px;
  text-align: left;
  white-space: normal;
}

.shop-buy-button:disabled,
.shop-close-button:disabled,
.shop-form button:disabled {
  color: #808080;
  cursor: default;
}

.shop-close-button {
  color: #800000;
  font-weight: 700;
}

.shop-form select,
.shop-form input {
  background: #ffffff;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #000000;
  min-width: 0;
  padding: 2px;
  width: 100%;
}

.shop-field {
  display: grid;
  gap: 2px;
}

.shop-field span {
  color: #800000;
  font-size: 12px;
}

.scene-frame::after {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.12) 1px,
    transparent 1px,
    transparent 4px
  );
  content: "";
  inset: 0;
  opacity: 0.16;
  pointer-events: none;
  position: absolute;
}

.scene-frame img {
  display: block;
  height: 100%;
  image-rendering: auto;
  object-fit: cover;
  width: 100%;
}

.shop-inline-slot {
  display: none;
}

.shop-inline-slot.active {
  display: block;
  margin: 5px;
}

.shop-toggle-button {
  align-items: center;
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  bottom: 8px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
  color: #000080;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 36px;
  padding: 5px 9px;
  position: absolute;
  right: 8px;
  white-space: nowrap;
  z-index: 4;
}

.shop-toggle-button.hidden {
  display: none;
}

.tone-neutral {
  filter: saturate(0.9) contrast(1.04);
}

.tone-warm {
  filter: sepia(0.12) saturate(0.92) contrast(1.08);
}

.tone-cold {
  filter: saturate(0.78) contrast(1.08) brightness(0.95);
}

.tone-alert {
  filter: saturate(1.08) contrast(1.12) brightness(0.9);
}

.scene-copy {
  background: #ffffee;
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  border-style: solid;
  border-width: 2px;
  display: grid;
  gap: 6px;
  margin: 5px;
  padding: 8px;
}

.level-label {
  color: #800000;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

#sceneText {
  color: #000000;
  max-width: 62ch;
}

.scene-feed {
  display: grid;
  gap: 4px;
  height: 58px;
  overflow-y: auto;
}

.scene-feed.hidden {
  visibility: hidden;
}

.scene-feed-line {
  align-items: start;
  background: #ffffff;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  display: block;
  min-height: 25px;
  padding: 4px 5px;
}

.scene-feed-line span {
  line-height: 1.35;
}

.scene-feed-line.danger {
  background: #ffdddd;
  color: #6a0000;
}

.scene-feed-line.gain {
  background: #e8fff4;
  color: #003b2d;
}

.scene-feed-line.market {
  background: #fff0cc;
  color: #593000;
}

.scene-feed-line.transit {
  background: #e8ecff;
  color: #000060;
}

.scene-feed-line.equipment {
  background: #f0e8ff;
  color: #4a207a;
}

.scene-feed-line.photo {
  background: #eef7ff;
  color: #003058;
}

.scene-feed-line.base {
  background: #e8fff0;
  color: #003d2a;
}

.scene-feed-line.storage {
  background: #eef8dd;
  color: #284000;
}

.scene-feed-line.info {
  background: #ffffee;
  color: #000000;
}

.scene-event-item,
.scene-event-count,
.scene-event-currency,
.scene-event-damage,
.scene-event-equipment,
.scene-event-photo,
.scene-event-level,
.scene-event-base {
  font-family: var(--mono);
  font-weight: 700;
}

.scene-event-item {
  color: #008000;
}

.scene-event-count {
  color: #0000cc;
}

.scene-event-currency {
  color: #9a4f00;
}

.scene-event-damage {
  color: #cc0000;
}

.scene-event-equipment {
  color: #551a8b;
}

.scene-event-photo {
  color: #004a80;
}

.scene-event-level {
  color: #000080;
}

.scene-event-base {
  color: #006050;
}

.combat-strip {
  background: #000000;
  border: 2px inset var(--panel);
  color: #ffcccc;
  display: grid;
  font-family: var(--mono);
  gap: 2px;
  margin: 5px;
  padding: 5px;
}

.combat-strip.hidden {
  display: none;
}

.action-grid {
  background: #d8d2bd;
  border-top: 1px solid var(--shadow-dark);
  display: grid;
  gap: 5px;
  padding: 5px;
}

.combat-actions {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.direction-pad {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.base-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.base-actions[hidden] {
  display: none;
}

.direction-pad > span {
  min-height: 28px;
}

.action-button {
  align-items: center;
  display: flex;
  font-size: 13px;
  justify-content: center;
  min-width: 0;
  text-align: center;
  white-space: normal;
}

.action-button.primary {
  color: #0000cc;
  font-weight: 700;
}

.action-button.danger {
  color: #cc0000;
  font-weight: 700;
}

.action-button.base {
  color: #006050;
  font-weight: 700;
}

.action-button.direction {
  gap: 5px;
  color: #000080;
}

.direction-label {
  min-width: 0;
}

.direction-symbol {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #66ff66;
  display: inline-flex;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-width: 24px;
  padding: 3px 4px;
}

.direction-symbol.visited {
  color: #d8d8d8;
}

.direction-symbol.shop {
  color: #ffff66;
}

.direction-symbol.exit {
  color: #88ccff;
}

.direction-symbol.danger {
  color: #ff8080;
}

.direction-symbol.memo {
  color: #ffa0ff;
}

.direction-symbol.cache {
  color: #ffdd66;
}

.direction-symbol.base {
  color: #66ffff;
}

.direction-symbol.survey {
  color: #ffd0ff;
}

.direction-symbol.discovery {
  color: #66ccff;
}

.direction-symbol.blocked,
.direction-symbol.void {
  color: #606060;
}

.direction-legend {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #66ff66;
  display: flex;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  gap: 4px 8px;
  line-height: 1.35;
  padding: 3px 5px;
}

.action-button:disabled {
  color: #808080;
  cursor: default;
}

.meter-list {
  display: grid;
  gap: 7px;
}

.meter {
  display: grid;
  gap: 2px;
}

.meter-head {
  align-items: center;
  color: #000000;
  display: flex;
  font-family: var(--mono);
  font-size: 12px;
  justify-content: space-between;
}

.meter-track {
  background: #ffffff;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  height: 13px;
  overflow: hidden;
}

.meter-fill {
  background:
    repeating-linear-gradient(
      90deg,
      #33cc33 0,
      #33cc33 7px,
      #239023 7px,
      #239023 9px
    );
  height: 100%;
  min-width: 2px;
}

.meter-fill.warn {
  background:
    repeating-linear-gradient(
      90deg,
      #ffcc33 0,
      #ffcc33 7px,
      #cc9900 7px,
      #cc9900 9px
    );
}

.meter-fill.danger {
  background:
    repeating-linear-gradient(
      90deg,
      #ff3333 0,
      #ff3333 7px,
      #a00000 7px,
      #a00000 9px
    );
}

.inventory-block,
.storage-block,
.settlement-block,
.equipment-block,
.memory-block,
.album-section,
.discovery-section,
.notes-section,
.log-section,
.operations-section {
  display: grid;
  gap: 5px;
}

.album-section[hidden],
.discovery-section[hidden] {
  display: none;
}

.inventory-list,
.storage-list,
.settlement-facilities,
.settlement-storage-list,
.settlement-message-list,
.equipment-list,
.photo-list,
.discovery-list,
.note-list,
.chat-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
}

.inventory-list,
.storage-list,
.settlement-facilities,
.settlement-storage-list,
.settlement-message-list,
.equipment-list,
.photo-list,
.discovery-list,
.note-list {
  list-style: none;
}

.inventory-list li,
.storage-list li,
.settlement-facilities li,
.settlement-storage-list li,
.settlement-message-list li,
.equipment-list li,
.photo-list li,
.discovery-list li,
.note-list li,
.chat-list li {
  background: #ffffee;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #000000;
  padding: 4px 5px;
}

.inventory-list li {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.inventory-list li.inventory-row,
.storage-list li.storage-row,
.note-list li.trace-row {
  align-items: stretch;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.inventory-row-body,
.storage-row-body,
.trace-row-body {
  align-items: baseline;
  display: grid;
  gap: 1px 5px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.trace-row-body {
  grid-template-columns: minmax(0, 1fr);
}

.inventory-row-body em {
  color: #606060;
  font-family: var(--mono);
  font-size: 10.5px;
  font-style: normal;
  grid-column: 1 / -1;
  line-height: 1.2;
}

.inventory-row-actions,
.storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
}

.inventory-row-actions button,
.storage-actions button,
.storage-list button,
.settlement-panel button,
.note-list button,
.chat-list button,
.discovery-record button,
.operations-actions button {
  align-self: center;
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  color: #000080;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  min-height: 24px;
  padding: 2px 6px;
}

.inventory-row-actions button:disabled,
.storage-actions button:disabled,
.storage-list button:disabled,
.settlement-panel button:disabled,
.note-list button:disabled,
.chat-list button:disabled,
.discovery-record button:disabled,
.operations-actions button:disabled {
  color: #808080;
  cursor: default;
}

.inventory-list strong {
  color: #000080;
  font-family: var(--mono);
}

.settlement-panel {
  display: grid;
  gap: 5px;
}

.settlement-summary {
  background: #eef3ff;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  display: grid;
  gap: 2px;
  padding: 5px;
}

.settlement-summary strong,
.settlement-subhead,
.settlement-facility-body strong,
.settlement-message-list strong {
  color: #000080;
}

.settlement-summary span,
.settlement-empty {
  color: #303030;
  font-size: 11.5px;
  line-height: 1.25;
}

.settlement-actions,
.settlement-storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.settlement-actions {
  justify-content: flex-end;
}

.settlement-subhead {
  font-weight: 700;
  line-height: 1.2;
  padding-top: 2px;
}

.settlement-facility-row {
  align-items: stretch;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.settlement-facility-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.settlement-facility-body strong {
  line-height: 1.2;
}

.settlement-facility-body span,
.settlement-facility-body em {
  color: #404040;
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.2;
}

.settlement-storage-row {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.settlement-storage-row strong {
  color: #000080;
  font-family: var(--mono);
}

.settlement-storage-actions button {
  min-width: 28px;
  padding: 1px 4px;
}

.settlement-message-list li {
  display: grid;
  gap: 1px;
}

.settlement-message-list span {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.trace-row-body strong {
  color: #000080;
  font-family: var(--mono);
  font-size: 11px;
}

.trace-row-body span {
  overflow-wrap: anywhere;
}

.trace-warning {
  background: #fff0f0 !important;
}

.trace-sign {
  background: #f0f7ff !important;
}

.trace-cache {
  background: #fff7d0 !important;
}

.currency-item {
  background: #fff7b8 !important;
}

.carry-summary,
.storage-access {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #66ff66;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
  min-height: 24px;
  overflow-wrap: anywhere;
  padding: 3px 5px;
}

.carry-summary.full {
  color: #ffff66;
}

.carry-summary.over {
  color: #ff9999;
}

.storage-access {
  color: #c0c0c0;
}

.storage-access.available {
  color: #66ff66;
}

.storage-actions {
  background: #d8d2bd;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  padding: 3px;
}

.equipment-summary {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #66ff66;
  font-family: var(--mono);
  font-size: 12px;
  min-height: 24px;
  padding: 3px 5px;
}

.equipment-list li {
  display: grid;
  gap: 4px;
}

.equipment-slot-row,
.equipment-spare-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.equipment-row-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.equipment-row-body strong {
  color: #000080;
  font-size: 12px;
  line-height: 1.25;
}

.equipment-row-body span {
  color: #404040;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.25;
}

.equipment-list button {
  align-self: center;
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  color: #000080;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  min-height: 24px;
  padding: 2px 6px;
}

.equipment-list button:disabled {
  color: #808080;
  cursor: default;
}

.memory-slot {
  display: grid;
  gap: 3px;
}

.memory-equipped,
.memory-spare-row {
  background: #ffffee;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 4px 5px;
}

.memory-row-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.memory-row-body strong {
  color: #004a80;
  font-size: 12px;
  line-height: 1.25;
}

.memory-row-body span,
.memory-empty {
  color: #404040;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.25;
}

.memory-empty {
  background: #ffffee;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  margin: 0;
  padding: 4px 5px;
}

.memory-slot button,
.photo-actions button {
  align-self: center;
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  color: #000080;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  min-height: 24px;
  padding: 2px 6px;
}

.memory-slot button:disabled,
.photo-actions button:disabled {
  color: #808080;
  cursor: default;
}

.equipment-heading {
  background: #d8d2bd !important;
  color: #800000 !important;
  font-weight: 700;
  padding: 2px 5px !important;
}

.photo-summary {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #66ff66;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  min-height: 24px;
  overflow-wrap: anywhere;
  padding: 3px 5px;
}

.photo-list {
  max-height: 360px;
  overflow-x: hidden;
  overflow-y: auto;
}

.photo-card {
  display: grid;
  gap: 5px;
  grid-template-columns: 64px minmax(0, 1fr);
}

.photo-preview-button {
  align-self: start;
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  height: auto;
  min-height: 0;
  padding: 0;
  width: 64px;
}

.photo-preview-button:focus-visible {
  outline: 2px solid #000080;
  outline-offset: 2px;
}

.photo-preview-button:hover .photo-thumb {
  filter: brightness(1.08) contrast(1.06);
}

.photo-thumb {
  aspect-ratio: 4 / 3;
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  height: auto;
  object-fit: cover;
  width: 64px;
}

.photo-card-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.photo-card-body strong {
  color: #000080;
  font-size: 12px;
  line-height: 1.25;
}

.photo-card-body span,
.photo-card-body em,
.photo-memory-label {
  color: #404040;
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.photo-card-body em {
  color: #800000;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  grid-column: 1 / -1;
}

.photo-memory-label {
  align-self: center;
  color: #004a80;
}

.discovery-panel {
  display: grid;
  gap: 4px;
}

.discovery-panel-inner {
  display: grid;
  gap: 4px;
}

.discovery-summary {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #66ff66;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
  min-height: 22px;
  overflow-wrap: anywhere;
  padding: 3px 5px;
}

.discovery-actions {
  display: flex;
  justify-content: flex-end;
}

.discovery-actions button {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  color: #000080;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  min-height: 23px;
  padding: 1px 7px;
}

.discovery-actions button:disabled {
  color: #808080;
  cursor: default;
}

.discovery-record {
  background: #eef8ff;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  display: grid;
  gap: 2px;
  padding: 4px 5px;
}

.discovery-record.current {
  background: #fff7d0;
}

.discovery-record.discovery-pending {
  background: #fffbe8;
}

.discovery-record strong {
  color: #000080;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.25;
}

.discovery-record span,
.discovery-record em {
  color: #404040;
  font-family: var(--mono);
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.operations-panel,
.operations-panel-inner {
  display: grid;
  gap: 4px;
}

.operations-notice,
.operations-meta {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #66ff66;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
  min-height: 22px;
  overflow-wrap: anywhere;
  padding: 3px 5px;
}

.operations-meta {
  color: #c0c0c0;
}

.operations-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
}

body.photo-viewer-open {
  overflow: hidden;
}

.photo-viewer {
  align-items: center;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 14px;
  position: fixed;
  z-index: 100;
}

.photo-viewer.hidden {
  display: none;
}

.photo-viewer-window {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.5);
  display: grid;
  max-height: calc(100vh - 28px);
  max-width: 860px;
  min-width: min(100%, 320px);
  overflow: hidden;
  width: min(92vw, 860px);
}

.photo-viewer-titlebar {
  gap: 8px;
}

.photo-viewer-close {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 1px;
  color: #000000;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  min-height: 18px;
  padding: 2px 7px;
}

.photo-viewer-close:active {
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  padding: 3px 6px 1px 8px;
}

.photo-viewer-frame {
  background: #000000;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  margin: 6px;
  max-height: min(62vh, 620px);
  overflow: hidden;
}

.photo-viewer-frame img {
  display: block;
  height: 100%;
  max-height: min(62vh, 620px);
  object-fit: contain;
  width: 100%;
}

.photo-viewer-body {
  background: #ffffee;
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  border-style: solid;
  border-width: 2px;
  display: grid;
  gap: 4px;
  margin: 0 6px 6px;
  padding: 6px;
}

.photo-viewer-body h2 {
  font-size: 13px;
  margin: -4px -4px 2px;
  padding: 3px 5px;
}

.photo-viewer-meta,
.photo-viewer-detail,
.photo-viewer-memo {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.photo-viewer-memo {
  color: #800000;
}

.chat-list {
  list-style: none;
  max-height: 360px;
  overflow-x: hidden;
  overflow-y: scroll;
}

.chat-tabs {
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-tabs button {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  color: #000080;
  cursor: pointer;
  font: inherit;
  min-height: 24px;
  padding: 2px 6px;
}

.chat-tabs button.active {
  background: #ffffee;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  color: #800000;
  font-weight: 700;
}

.proximity-notice {
  background: #101010;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  color: #c8ffb0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  padding: 4px 5px;
}

.proximity-notice.hidden {
  display: none;
}

.chat-message {
  display: grid;
  gap: 2px;
}

.chat-message strong {
  color: #000080;
  font-family: var(--mono);
  font-size: 12px;
}

.chat-message em {
  color: #606060;
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
}

.chat-message span {
  font-size: 12px;
  line-height: 1.35;
}

.chat-message span,
.note-list li,
.scene-feed-line {
  overflow-wrap: anywhere;
}

.chat-message.self {
  background: #e8fff4 !important;
}

.chat-message.remote {
  background: #ffffee !important;
}

.chat-message.system {
  background: #eeeeee !important;
  color: #404040 !important;
}

.chat-form {
  background: #d8d2bd;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 4px;
}

.chat-form input,
.chat-form button {
  font: inherit;
  min-height: 26px;
}

.chat-form input {
  background: #ffffff;
  border-color: var(--shadow-darker) var(--highlight) var(--highlight) var(--shadow-darker);
  border-style: solid;
  border-width: 2px;
  min-width: 0;
  padding: 2px 4px;
}

.chat-form button {
  background: var(--panel);
  border-color: var(--highlight) var(--shadow-darker) var(--shadow-darker) var(--highlight);
  border-style: solid;
  border-width: 2px;
  color: #000080;
  cursor: pointer;
  padding: 2px 7px;
}

.empty {
  color: #666666;
  font-style: normal;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--visited);
}

@media (max-width: 1000px) {
  .app-shell {
    margin: 0;
    max-width: none;
    min-height: 100vh;
    padding: 5px;
  }

  .registration-shell {
    margin: 0 auto;
    max-width: 720px;
    padding: 5px;
  }

  .registration-window {
    min-height: 100vh;
  }

  .game-layout {
    gap: 5px;
    grid-template-columns: 1fr;
  }

  .scene-panel {
    order: 1;
  }

  .status-panel {
    order: 2;
  }

  .record-panel {
    order: 3;
  }

  .action-button {
    min-height: 34px;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--desktop);
    font-size: 12px;
  }

  .app-shell {
    border-width: 1px;
    padding: 4px;
  }

  .topbar {
    display: none;
  }

  .marquee-strip {
    font-size: 11px;
    margin: 4px 0;
    padding: 1px 2px;
  }

  .registration-body {
    grid-template-columns: 1fr;
  }

  .job-main h1 {
    font-size: 24px;
  }

  .registration-form {
    gap: 6px;
    padding: 6px;
  }

  .registration-field input,
  .registration-field select,
  .registration-submit {
    min-height: 36px;
  }

  .window-titlebar {
    font-size: 11px;
    padding: 2px 3px;
  }

  .window-buttons i {
    height: 12px;
    width: 14px;
  }

  .scene-frame {
    margin: 4px;
  }

  .scene-copy {
    gap: 4px;
    margin: 4px;
    padding: 6px;
  }

  .level-label {
    font-size: 11px;
  }

  h1 {
    font-size: 18px;
    line-height: 1.2;
  }

  h2 {
    font-size: 12px;
    margin: -2px -2px 4px;
    padding: 3px 4px;
  }

  h3 {
    font-size: 12px;
  }

  #sceneText {
    font-size: 12px;
    line-height: 1.4;
    max-width: none;
  }

  .scene-feed {
    height: 52px;
  }

  .scene-feed-line {
    min-height: 22px;
    padding: 3px 4px;
  }

  .combat-strip {
    margin: 4px;
    padding: 4px;
  }

  .action-grid {
    gap: 4px;
    padding: 4px;
  }

  .action-button {
    font-size: 13px;
    min-height: 38px;
    padding: 5px 6px;
  }

  .status-panel,
  .record-panel {
    gap: 6px;
    padding: 4px;
  }

  #statusHeading {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  .meter-list {
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meter {
    gap: 1px;
  }

  .meter-head {
    font-size: 11px;
    line-height: 1.25;
  }

  .meter-track {
    border-width: 1px;
    height: 11px;
  }

  .inventory-block,
  .storage-block,
  .settlement-block,
  .equipment-block,
  .memory-block,
  .album-section,
  .notes-section,
  .log-section {
    gap: 4px;
  }

  .inventory-list,
  .storage-list,
  .settlement-storage-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-list li,
  .storage-list li,
  .settlement-facilities li,
  .settlement-storage-list li,
  .settlement-message-list li,
  .equipment-list li,
  .photo-list li,
  .note-list li,
  .chat-list li {
    padding: 3px 4px;
  }

  .inventory-list li,
  .storage-list li,
  .settlement-storage-list li {
    min-width: 0;
  }

  .inventory-list strong {
    margin-left: 5px;
  }

  .inventory-list li.inventory-row,
  .storage-list li.storage-row,
  .settlement-facility-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .inventory-row-actions,
  .storage-actions,
  .settlement-actions {
    justify-content: stretch;
  }

  .inventory-row-actions button,
  .storage-actions button,
  .storage-list button,
  .settlement-panel button {
    flex: 1 1 auto;
    min-height: 30px;
    padding: 2px 6px;
  }

  .carry-summary,
  .storage-access {
    font-size: 11px;
    min-height: 22px;
    padding: 2px 4px;
  }

  .equipment-summary {
    font-size: 11px;
    min-height: 22px;
    padding: 2px 4px;
  }

  .equipment-list li {
    gap: 3px;
  }

  .equipment-row-body strong {
    font-size: 12px;
  }

  .equipment-row-body span {
    font-size: 11px;
  }

  .equipment-list button {
    min-height: 30px;
    padding: 2px 6px;
  }

  .memory-slot button,
  .photo-actions button {
    min-height: 30px;
    padding: 2px 6px;
  }

  .memory-equipped,
  .memory-spare-row,
  .memory-empty {
    padding: 3px 4px;
  }

  .equipment-heading {
    padding: 2px 4px !important;
  }

  .photo-summary {
    font-size: 11px;
    min-height: 22px;
    padding: 2px 4px;
  }

  .photo-list {
    max-height: 240px;
  }

  .photo-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .photo-preview-button {
    width: 58px;
  }

  .photo-thumb {
    width: 58px;
  }

  .photo-viewer {
    padding: 6px;
  }

  .photo-viewer-window {
    max-height: calc(100vh - 12px);
    min-width: 0;
    width: 100%;
  }

  .photo-viewer-frame {
    margin: 4px;
    max-height: 54vh;
  }

  .photo-viewer-frame img {
    max-height: 54vh;
  }

  .photo-viewer-body {
    margin: 0 4px 4px;
    padding: 5px;
  }

  .photo-viewer-meta,
  .photo-viewer-detail,
  .photo-viewer-memo {
    font-size: 11px;
  }

  .chat-tabs button {
    min-height: 32px;
    padding: 3px 6px;
  }

  .proximity-notice {
    font-size: 11px;
    padding: 3px 4px;
  }

  .chat-list {
    max-height: 240px;
  }

  .chat-form {
    gap: 3px;
    padding: 3px;
  }

  .chat-form input,
  .chat-form button {
    font-size: 13px;
    min-height: 34px;
  }

  .shop-inline-slot.active {
    display: block;
    margin: 4px;
  }

  .shop-panel {
    padding: 5px;
  }

  .shop-toggle-button {
    bottom: 8px;
    min-height: 36px;
    padding: 5px 9px;
    right: 8px;
  }

  .shop-panel h3 {
    font-size: 12px;
  }

  .shop-buy-button,
  .shop-form button,
  .shop-form select,
  .shop-form input {
    min-height: 32px;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 3px;
  }

  .brand-title {
    font-size: 15px;
  }

  .counter-box {
    font-size: 10px;
  }

  .topbar-readout span {
    font-size: 10.5px;
    padding: 3px 4px;
  }

  .scene-frame,
  .scene-copy {
    margin: 3px;
  }

  .chat-list {
    max-height: 220px;
  }

  .photo-list {
    max-height: 220px;
  }
}

@media (max-width: 360px) {
  .brand-mark {
    display: none;
  }

  .action-button {
    font-size: 12px;
  }
}
