/* Shared styles for JSON Pretty Print and Base64 Encoder/Decoder */
:root {
  --main: #61756a;
  --ink: #0b2b2b;
  --panel: #fff;
  --muted: #eef2ef;
  --border: #d2dbd5;
  --btn: #4e6157;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--main);
  color: #fff;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1rem;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: .3px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.navlinks a {
  color: #fff;
  text-decoration: none;
  margin-left: 1rem;
  font-weight: 600;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.navlinks a:hover {
  text-decoration: underline;
}
.app {
  display: grid;
  grid-template-columns: 1fr 260px 1fr;
  gap: 1rem;
  padding: 1rem;
  flex: 1 1 auto;
  height: auto;
  box-sizing: border-box;
}
.pane {
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  min-height: 0;
}
.pane header {
  padding: .6rem .8rem;
  background: var(--muted);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
textarea {
  width: 100%;
  height: 100%;
  border: none;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: .8rem;
  outline: none;
  white-space: pre-wrap;
}
.status {
  padding: .4rem .8rem;
  font-size: .8rem;
  color: #4b6b6b;
  border-top: 1px solid var(--border);
  background: #f8fff9;
}
.controls {
  background: var(--panel);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  padding: .8rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-self: stretch;
  justify-content: flex-start;
}
.controls h2 {
  margin: 0 0 .4rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
select, input[type="text"] {
  width: 100%;
  padding: .55rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: .95rem;
}
.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: .7rem .8rem;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  background: var(--btn);
  color: #fff;
}
.btn.secondary {
  background: #e9f7ef;
  color: var(--ink);
}
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}
dialog.modal {
  border: none;
  border-radius: 12px;
  width: min(560px, 90vw);
  padding: 0;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.modal header {
  background: var(--main);
  color: #fff;
}
.modal .body {
  padding: 1rem;
  background: #fff;
  color: var(--ink);
}
.modal .row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
  margin: .6rem 0;
}
.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .8rem 1rem;
  background: #fafefe;
  border-top: 1px solid var(--border);
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .controls { order: -1; }
  body { height: auto; overflow: auto; }
}
.hint {
  font-size: .8rem;
  color: #3d5b4b;
}
