:root {
  color-scheme: dark;
  --background: #121517;
  --surface: #1b2023;
  --panel: #202629;
  --line: #343e42;
  --text: #f6f8f5;
  --muted: #aebbb5;
  --mint: #9af0b9;
  --mint-hover: #b8ffd0;
  --orange: #ff9b69;
  font-family: "Instrument Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--text); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
input, select, button { font: inherit; }
button, summary, select, .pick-button { cursor: pointer; }

.shell { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.topbar { background: #181c1e; border-bottom: 1px solid #2a3335; }
.topbar-content { display: flex; justify-content: space-between; align-items: center; min-height: 4.35rem; gap: 1rem; }
.brand, .language { display: flex; align-items: center; gap: .65rem; }
.brand { font: 750 1.12rem "Bricolage Grotesque", sans-serif; white-space: nowrap; }
.app-icon {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  width: 1.75rem;
  aspect-ratio: 1;
  padding: .33rem;
  border-radius: .48rem;
  background: #2a4738;
}
.app-icon i { background: #c1f6cc; border-radius: 1px; }
.app-icon i:nth-child(2) { background: var(--orange); }
.app-icon i:nth-child(3) { background: #61b58b; }
.language { color: var(--muted); font-size: .81rem; }
select {
  min-width: 0;
  max-width: 100%;
  min-height: 2.35rem;
  padding: .3rem .55rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: #202628;
  color: var(--text);
}

.workspace { padding: clamp(1.6rem, 5vw, 4rem) 0 3rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr);
  align-items: center;
  gap: clamp(1rem, 3.6vw, 3rem);
  padding: clamp(1rem, 3.6vw, 2.7rem);
  border: 1px solid #3a4945;
  border-radius: 1.25rem;
  background:
    radial-gradient(ellipse at 8% 10%, #233c31, transparent 64%),
    linear-gradient(135deg, #1b2a26, #1e2326 64%);
}
.hero-copy { padding: .6rem 0 .6rem .15rem; }
.translation-pair { color: var(--mint); font: 650 .92rem "Instrument Sans", sans-serif; letter-spacing: .025em; }
h1 {
  margin: .7rem 0 1rem;
  font: 800 clamp(2.35rem, 5vw, 4.55rem)/1.04 "Bricolage Grotesque", "Yu Gothic UI", Meiryo, sans-serif;
  letter-spacing: -.055em;
  text-wrap: balance;
}
:lang(ja) h1 { font-size: clamp(2rem, 4.35vw, 3.8rem); line-height: 1.16; letter-spacing: -.035em; }
.intro { color: var(--muted); font-size: clamp(.95rem, 1.65vw, 1.08rem); line-height: 1.75; max-width: 28rem; text-wrap: pretty; }
.input-panel { min-width: 0; padding: .7rem; border: 1px solid #3d4c48; border-radius: 1rem; background: #171e1d; }

.file-box {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .45rem;
  padding: clamp(1.15rem, 3.1vw, 2rem) .8rem;
  min-height: 13rem;
  text-align: center;
  border: 1px dashed #6a9780;
  border-radius: .72rem;
  background:
    radial-gradient(circle, #5e897139 1px, transparent 1px) 0 0 / 17px 17px,
    #23332d;
}
.file-box.is-dragging { border-color: var(--mint); background-color: #305644; outline: 2px solid var(--mint); outline-offset: -2px; }
.file-icon {
  position: relative;
  width: 2.25rem;
  height: 2.55rem;
  border: 2px solid #a8e9ba;
  border-radius: .38rem;
  background: #345345;
}
.file-icon::before {
  content: "";
  position: absolute;
  width: .48rem;
  height: .48rem;
  border-top: 2px solid #baf5ca;
  border-left: 2px solid #baf5ca;
  transform: rotate(45deg);
  left: .68rem;
  top: .61rem;
}
.file-icon::after {
  content: "";
  position: absolute;
  width: 2px;
  height: .86rem;
  background: #baf5ca;
  top: .73rem;
  left: .95rem;
}
.drop-title { font-size: 1rem; font-weight: 700; }
#file-drop-help, .selected-file { color: #c4d4cb; font-size: .85rem; line-height: 1.45; }
.selected-file { max-width: 100%; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pick-button, button {
  display: inline-grid;
  place-items: center;
  padding: .54rem .9rem;
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  font-size: .87rem;
  font-weight: 700;
  text-align: center;
}
.pick-button, #translate-all, #download:not(:disabled) { background: var(--mint); color: #142d20; }
.pick-button { margin-top: .2rem; min-width: 10.5rem; }
.pick-button:hover, #translate-all:not(:disabled):hover, #download:not(:disabled):hover { background: var(--mint-hover); }
#mod-file:disabled + .pick-button { opacity: .65; cursor: default; }
#mod-file:focus-visible + .pick-button, :is(a, button, summary, select, input, pre):focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.extra-inputs { display: flex; flex-wrap: wrap; gap: .3rem 1rem; padding: .62rem .15rem .05rem; }
.extra-inputs details { flex: 0 1 auto; min-width: 0; }
.extra-inputs details[open] { flex-basis: 100%; }
summary { color: #d1ded6; font-size: .85rem; font-weight: 650; }
summary:hover { color: var(--mint); }
.field { display: grid; gap: .4rem; margin-top: .5rem; }
.field label { color: var(--muted); font-size: .87rem; line-height: 1.5; }
#modpack-files { width: 100%; color: var(--muted); }

.format-help { margin: 1rem 0 1.35rem; border-bottom: 1px solid #2e3638; padding: 0 .1rem .8rem; }
.format-help summary { line-height: 1.6; }
.format-chips { display: inline-flex; flex-wrap: wrap; gap: .28rem; margin-left: .55rem; }
.format-chips span {
  padding: .04rem .36rem;
  border: 1px solid #3d4843;
  border-radius: .29rem;
  color: #c1cfc5;
  font: 650 .69rem/1.45 "Instrument Sans", sans-serif;
}
.format-help p { margin-top: .5rem; font-size: .85rem; color: var(--muted); line-height: 1.65; }

.results { overflow: hidden; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); }
.results-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; padding: .85rem 1rem; }
h2 { font-size: 1.08rem; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; }
button { background: #293438; border-color: #3d494d; color: var(--text); }
button:not(:disabled):hover { background: #39464a; }
button:disabled, #translate-all:disabled { color: #9ba8a3; background: #242a2d; border-color: #323b3d; cursor: default; }
#status {
  margin: 0;
  min-height: 4rem;
  max-height: 15rem;
  padding: .82rem 1rem;
  border-top: 1px solid #333c3e;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: #161b1d;
  color: #c3d4c9;
  font: .84rem/1.7 "IBM Plex Mono", Consolas, "Yu Gothic UI", Meiryo, monospace;
}
.comparison, .comparison-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.comparison { border-top: 1px solid var(--line); }
.comparison h3 { padding: .55rem 1rem; color: var(--muted); font-size: .82rem; font-weight: 650; }
.comparison h3:nth-child(2) { color: var(--mint); border-left: 1px solid var(--line); }
.comparison-rows { grid-column: 1 / -1; max-height: 26rem; overflow: auto; }
.comparison-row { border-top: 1px solid var(--line); }
.comparison-row p { padding: .65rem 1rem; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.comparison-row p + p { border-left: 1px solid var(--line); background: #1d2a24; }

@media (max-width: 48rem) {
  .shell { width: calc(100% - 2rem); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { text-align: center; }
  .intro { margin-inline: auto; }
}

@media (max-width: 35rem) {
  .topbar-content { min-height: 3.75rem; }
  .language > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .brand { font-size: .93rem; }
  .language select { max-width: 9rem; font-size: .77rem; }
  .format-chips { display: flex; margin: .4rem 0 0; }
  .results-header { align-items: stretch; flex-direction: column; }
  .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #download { grid-column: 1 / -1; }
  .comparison h3, .comparison-row p { padding-inline: .65rem; }
}

.header-controls { display: flex; align-items: center; gap: .7rem; }
#appearance { min-width: 0; }

