:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #667384;
  --line: #d8e1e3;
  --soft-line: #e8eef0;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-hover: #0b5f59;
  --blue: #2563eb;
  --amber: #b45309;
  --shadow: 0 18px 50px rgba(25, 38, 45, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(292px, 374px) minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell > * {
  min-width: 0;
}

.panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 28px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 850;
  box-shadow: inset 0 -8px 20px rgba(0, 0, 0, 0.12);
}

.home-link,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.home-link {
  min-width: 68px;
  height: 36px;
  padding: 0 12px;
}

.secondary-action {
  width: 100%;
  padding: 0 12px;
}

.home-link:hover,
.home-link:focus-visible,
.secondary-action:hover:not(:disabled),
.secondary-action:focus-visible:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.secondary-action:hover:not(:disabled) {
  transform: translateY(-1px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.15;
  word-break: keep-all;
}

h2 {
  font-size: 19px;
  line-height: 1.2;
}

.brand p,
.toolbar p,
.status,
.field,
.source-card span,
.source-card small,
.coordinate-panel > span,
.coordinate-meta span,
.metric-card span,
.results-heading span,
.result-row small {
  color: var(--muted);
}

.input-panel,
.control-group {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 680;
}

.field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 116px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

select {
  height: 42px;
  padding: 0 12px;
}

textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.action-grid,
.copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.primary-action {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 780;
  transition: background 0.18s ease, transform 0.18s ease;
}

.primary-action:hover:not(:disabled),
.primary-action:focus-visible:not(:disabled) {
  background: var(--accent-hover);
  outline: none;
  transform: translateY(-1px);
}

.primary-action:disabled,
.secondary-action:disabled,
.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.source-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #f8fbfa;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.source-card:hover,
.source-card:focus-visible {
  border-color: var(--accent);
  background: #edf8f6;
  outline: none;
}

.source-card strong {
  font-size: 17px;
}

.source-card small {
  font-size: 12px;
}

.status {
  min-height: 44px;
  font-size: 13px;
}

.copyright {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  align-content: start;
  gap: 24px;
  min-width: 0;
  padding: 34px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

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

.toolbar-action {
  width: auto;
  min-width: 104px;
  height: 40px;
  flex: 0 0 auto;
}

.coordinate-panel,
.metric-card,
.results-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.coordinate-panel {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.coordinate-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.coordinate-values output {
  display: block;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #f8fbfa;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.coordinate-values output::before {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 760;
}

#latitudeOutput::before {
  content: "위도";
}

#longitudeOutput::before {
  content: "경도";
}

.coordinate-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.coordinate-meta strong,
.coordinate-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.metric-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 16px;
}

.metric-card strong {
  min-width: 0;
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.results-panel {
  display: grid;
  min-width: 0;
  overflow: hidden;
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.results-list {
  display: grid;
  max-height: min(48vh, 520px);
  overflow: auto;
}

.result-row,
.empty-row {
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  background: #ffffff;
  color: inherit;
  text-align: left;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 20px;
  cursor: pointer;
}

.result-row:hover,
.result-row:focus-visible,
.result-row.is-active {
  background: #eff8f6;
  outline: none;
}

.result-row.is-active {
  box-shadow: inset 4px 0 0 var(--accent);
}

.result-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.result-row strong,
.result-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-coordinates {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 760;
  text-align: right;
}

.empty-row {
  padding: 28px 20px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .controls,
  .workspace {
    padding: 22px;
  }

  .copyright {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .brand-row,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .home-link,
  .toolbar-action {
    width: 100%;
  }

  .action-grid,
  .copy-grid,
  .coordinate-values,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .result-row {
    grid-template-columns: 1fr;
  }

  .result-coordinates {
    text-align: left;
  }
}
