:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #16202a;
  --muted: #657386;
  --line: #dfe7f0;
  --blue: #1d5fd1;
  --blue-soft: #e8f0ff;
  --green: #16835f;
  --yellow: #ffd72e;
  --red: #d53b3b;
  --shadow: 0 18px 45px rgba(31, 48, 71, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Malgun Gothic", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 4vw, 52px);
  background: #101820;
  color: #fff;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.status-pill {
  min-width: 116px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.status-pill.running {
  background: var(--yellow);
  color: #1f1a00;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(520px, 1.5fr);
  gap: 18px;
  padding: 22px clamp(18px, 4vw, 52px) 46px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.watch-panel,
.log-panel {
  grid-column: 2;
}

.settings-panel {
  grid-column: 1;
}

.search-panel {
  grid-row: span 2;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-head p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.search-form,
.settings-grid {
  display: grid;
  gap: 14px;
}

.search-results {
  display: grid;
  gap: 8px;
}

.result-button {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  height: auto;
  min-height: 58px;
  padding: 8px;
  text-align: left;
}

.result-button img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.result-button span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
  color: #334254;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(29, 95, 209, 0.2);
  border-color: var(--blue);
}

button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  border-color: var(--blue);
}

.primary {
  height: 46px;
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 22px;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td strong {
  display: block;
  margin-bottom: 4px;
}

td span {
  color: var(--muted);
  font-size: 13px;
}

.price-input {
  width: 150px;
  height: 36px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.badge.up {
  background: #e7f7ef;
  color: var(--green);
}

.danger {
  color: var(--red);
}

.empty-state {
  display: none;
  padding: 22px 0 6px;
  color: var(--muted);
  text-align: center;
}

.empty-state.visible {
  display: block;
}

.alert-log {
  display: grid;
  gap: 10px;
  min-height: 74px;
  margin: 0;
  padding-left: 20px;
}

.alert-log:empty::before {
  content: "아직 알림 기록이 없습니다.";
  color: var(--muted);
}

.alert-log li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  line-height: 1.45;
}

@media (max-width: 960px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .search-panel,
  .watch-panel,
  .settings-panel,
  .log-panel {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 560px) {
  .panel {
    padding: 16px;
  }

  .panel-head {
    flex-direction: column;
  }

  .toolbar,
  .toolbar button {
    width: 100%;
  }
}
