:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1a1f2b;
  --muted: #4f5a73;
  --line: #d6dbea;
  --primary: #0f4bcf;
  --tab-bg: #e8edf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  background: linear-gradient(180deg, #eef2ff, var(--bg));
  color: var(--text);
}

.page {
  width: min(860px, 92vw);
  margin: 40px auto;
}

.header h1 {
  margin: 0;
  font-size: 28px;
}

.header p {
  color: var(--muted);
  margin-top: 8px;
}

.quick-steps {
  margin: 14px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
}

.quick-steps-title {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  color: #1f3f86;
  font-size: 18px;
  font-weight: 700;
}

.quick-steps-note {
  margin: 0 0 10px;
  color: #5a6987;
  font-size: 13px;
}

.quick-steps ol {
  margin: 0;
  padding-left: 18px;
  color: #46506a;
  font-size: 14px;
  line-height: 1.5;
}

.bottom-actions {
  margin: 16px 0 4px;
}

.ghost-link {
  display: inline-block;
  border: 1px solid #c4d1ec;
  border-radius: 10px;
  padding: 10px 14px;
  background: #edf2fd;
  color: #2d4f97;
  font-weight: 700;
  text-decoration: none;
}

.ghost-link:hover {
  background: #e5ecfb;
}

.ghost-link:focus-visible {
  outline: 2px solid #8fb0ef;
  outline-offset: 2px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  padding: 8px;
  border: 1px solid #dbe2f0;
  border-radius: 14px;
  background: var(--tab-bg);
  width: fit-content;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: #3f4861;
  font-weight: 600;
}

.tab.is-active {
  background: var(--surface);
  border-color: #bfccea;
  color: var(--text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  gap: 8px;
}

.row input {
  flex: 1;
}

.input-action-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.input-action-row input {
  flex: 1;
}

.hidden {
  display: none;
}

label {
  font-weight: 600;
  font-size: 16px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}

#open-password {
  font-size: 15px;
}

.primary {
  width: fit-content;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.inline-action {
  min-width: 88px;
  padding: 10px 12px;
  font-size: 14px;
  align-self: stretch;
}

.secondary,
.row button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: #2f3a52;
  font-weight: 600;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

#copy-link.is-emphasis {
  border-color: #0f4bcf;
  background: #0f4bcf;
  color: #fff;
}

#copy-result {
  width: fit-content;
}

.delivery-block {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #dce3f3;
  border-radius: 12px;
  background: #f8faff;
  padding: 12px;
}

.delivery-title {
  margin: 0 0 8px;
  color: #3b4868;
  font-size: 13px;
  font-weight: 700;
}

.notice {
  color: var(--muted);
  margin: 0 0 6px;
}

.guide {
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.security-notice {
  margin: 2px 0 0;
  padding: 10px 12px;
  border: 1px solid #f2c278;
  border-radius: 10px;
  background: #fff7ea;
  color: #8a4b00;
  font-size: 14px;
}

.security-notice strong {
  font-weight: 700;
}

.counter {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 13px;
  align-self: flex-end;
}

.counter.warn {
  color: #9a6700;
}

.counter.limit {
  color: #b42318;
  font-weight: 700;
}

.counter.shake {
  animation: shakeX 0.24s ease-in-out;
}

.status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #dbe2f1;
  background: #f6f8fc;
  color: #3f4a63;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
}

.status:empty {
  display: none;
}

.status.neutral {
  border-color: #c7d8fb;
  background: #eef4ff;
  color: #244a9b;
}

.status.success {
  border-color: #b9e5ca;
  background: #eefbf2;
  color: #155734;
}

#generated-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status.error {
  border-color: #f3c1bc;
  background: #fff2f0;
  color: #9e1f15;
}

.status.warn {
  border-color: #f2d49a;
  background: #fff8ec;
  color: #8a5a00;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.meta:empty {
  display: none;
}

.result {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 120px;
  background: #f8faff;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .input-action-row {
    flex-direction: column;
  }

  .inline-action {
    width: 100%;
  }
}

@keyframes shakeX {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
