:root {
  color-scheme: light;
  --bg: #eef1f4;
  --surface: #f9fafb;
  --section: #ffffff;
  --line: #cfd6dd;
  --text: #151719;
  --muted: #58616b;
  --accent: #176b87;
  --button: #f4f6f8;
  --button-border: #9aa6b2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #748796;
  color: var(--text);
  font-family: "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1060px, calc(100vw - 20px));
  margin: 10px auto;
  background: var(--surface);
  border: 1px solid #d8dde2;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.window-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  background: #fbfcfd;
  border-bottom: 1px solid #dfe4e8;
}

.window-title h1 {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.title-mark {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(135deg, #176b87, #2b2f33);
}

.status-pill {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.workspace {
  display: grid;
  gap: 12px;
  padding: 14px 16px 0;
}

.band,
.result-band {
  background: var(--section);
  border: 1px solid var(--line);
  padding: 14px;
}

.band h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title-row h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 150px minmax(220px, 1fr) 240px;
  gap: 9px 10px;
  align-items: center;
}

.company-grid {
  display: grid;
  grid-template-columns: 24px minmax(220px, 1fr) 86px;
  gap: 8px 10px;
  align-items: center;
}

label {
  color: #111;
}

input {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
}

input:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

input:disabled {
  color: #777;
  background: #f1f3f5;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.check input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.inline-inputs {
  display: grid;
  grid-template-columns: repeat(5, minmax(54px, 1fr));
  gap: 6px;
}

.inline-action {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
}

.action-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

button,
.button-link {
  min-height: 30px;
  padding: 5px 12px;
  color: #000;
  background: var(--button);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: #fff;
}

button:disabled,
.button-link.disabled {
  color: #7c858d;
  cursor: not-allowed;
  pointer-events: none;
  background: #eef1f4;
}

.result-band {
  margin: 12px 16px 16px;
}

.result {
  width: 100%;
  min-height: 360px;
  margin: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #aab4be;
  color: #111;
  font-family: Consolas, "Malgun Gothic", monospace;
  font-size: 13px;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  max-width: min(560px, calc(100vw - 24px));
  transform: translateX(-50%);
  padding: 9px 12px;
  background: #1f2933;
  color: #fff;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 760px) {
  body {
    background: var(--surface);
  }

  .app-shell {
    width: 100vw;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .workspace {
    padding: 10px;
  }

  .form-grid,
  .company-grid {
    grid-template-columns: 1fr;
  }

  .inline-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-action,
  .action-band {
    display: grid;
    grid-template-columns: 1fr;
  }

  .result-band {
    margin: 10px;
  }
}
