.app{width: min(1280px, calc(100% - 32px));margin: 22px auto 20px;background:#fffdf8;border:1px solid #e2d8c8;border-radius:14px;box-shadow:0 8px 30px rgba(20,30,50,.08);display:flex;flex-direction:column;overflow:}
.intro{padding: 16px 18px 12px;}
h1{font-size: 20px; margin: 0 0 5px;}
.intro p {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}
.card { width: min(1240px, 100% - 40px); min-width: 0; margin: 20px auto; background: #fffdf8; border: 1px solid #e2d8c8; border-radius: 12px; box-shadow: 0 4px 18px rgba(20, 35, 50, 0.06); padding: 23px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
button { border: 1px solid transparent; border-radius: 7px; padding: 10px 14px; min-height: 40px; font: bold 14px/1.25 Arial, sans-serif; cursor: pointer; }
.primary { background: #000; color: #fff; }
.primary:hover { background: #333; }
.secondary { background: #fff; border-color: #cfd5da; color: #30363b; }
.secondary:hover { background: #f4f6f8; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid > * { min-width: 0; max-width: 100%; }
.label { display: block; font-weight: bold; margin-bottom: 9px; }
.pane-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.pane-tools .label { margin: 0; }
.file-row { display: flex; align-items: center; gap: 8px; }
.file-btn { display: inline-flex; align-items: center; border: 1px solid #cfd5da; border-radius: 7px; background: #fff; color: #30363b; font: bold 13px/1.2 Arial, sans-serif; margin:0; padding: 6px 10px; cursor: pointer; }
.file-btn:hover { background: #f4f6f8; }
.file-btn input { display: none; }
.encoding, .options select, .options input[type="text"] { border: 1px solid #cfd5da; border-radius: 7px; background: #fff; color: #30363b; font: 13px Arial, sans-serif; padding: 6px 8px; }
.encoding { max-width: 168px; }
.options input[type="text"] { width: 140px; }
.quiet { color: var(--muted); font-size: 12px; font-weight: normal; }
.editor { position: relative; width: 100%; max-width: 100%; border: 1px solid #cfd5da; border-radius: 8px; background: #fff; overflow: hidden; }
.editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.12); }
.nums { position: absolute; top: 0; left: 0; bottom: 0; width: 46px; box-sizing: border-box; padding: 13px 8px 13px 0; overflow: hidden; text-align: right; color: #9aa4b2; background: #f8fafc; border-right: 1px solid #edf0f3; font: 13px/20px Consolas, "Courier New", monospace; white-space: pre; user-select: none; }
textarea { display: block; width: calc(100% - 46px); max-width: calc(100% - 46px); min-width: 0; height: 320px; min-height: 160px; margin-left: 46px; resize: vertical; padding: 13px 14px; border: 0; background: transparent; font: 13px/20px Consolas, "Courier New", monospace; color: #202124; outline: none; tab-size: 2; white-space: pre; overflow: auto; }
textarea:focus { box-shadow: none; }
.meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 7px; }
.result { width: 100%; max-width: 100%; height: 320px; overflow: auto; border: 1px solid #cfd5da; border-radius: 8px; background: #fff; }
.result pre { margin: 0; padding: 13px 14px; min-height: 100%; width: max-content; min-width: 100%; box-sizing: border-box; white-space: pre; font: 13px/20px Consolas, "Courier New", monospace; color: #202124; }
.pane-tools button { min-height: 0; padding: 6px 12px; }
.empty { color: var(--muted); padding: 16px; font-size: 13px; }
.options { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; margin: 18px 0; padding: 14px; background: #fffdf8; border: 1px solid #e2d8c8; border-radius: 8px; }
.options label { display: flex; align-items: center; gap: 7px; font-size: 14px; }
#typeOptions { display: contents; }
#typeOptions[hidden] { display: none; }
.options input[type="checkbox"] { accent-color: var(--blue); width: auto; }
.status { min-height: 22px; font-size: 13px; margin-top: 8px; overflow-wrap: anywhere; color: #287346; }
.status.bad { color: var(--danger); }
.note { margin-top: 14px; padding: 13px 15px; border: 1px solid #e2d8c8; background: #fffdf8; border-radius: 8px; color: #29475d; font-size: 14px; }
@media (max-width: 760px) {
  .app, .card { min-width: 0; max-width: 100%; }
  .card { padding: 15px 12px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  textarea, .result { height: 220px; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar button { padding: 10px 8px; }
  .intro p { font-size: 14px; }
  .options { align-items: stretch; max-width: 100%; }
  .options label { max-width: 100%; min-width: 0; }
  #modeWrap, #customWrap { flex-direction: column; align-items: stretch; width: 100%; }
  .options select, .options input[type="text"] { display: block; width: 100%; max-width: 100%; min-width: 0; }
}